Get Started with A3L Authentication
To get started with A3L Authentication, follow this guide.
Requirements
A3L Authentication has the following requirements:
- A compatible Android device that runs on API Level 21 or newer.
- A project configured to compile against Android API Level 21 or newer.
Configure Google API Console
Before integrating A3L Authentication into your app, you need to set up a project and configure it in the Google API Console. To learn how to configure a Google API Console project for Authentication, see Configure a Google API Console project in the Google developer documentation.
- Go to your project in the Google API Console and find the Android client ID at https://console.cloud.google.com/apis/credentials . Make a note of the Client ID listed with type Android.
- If you use a server and need an ID token, you will need an OAuth 2.0 client ID. To get your OAuth 2.0 client ID, follow the instructions in Get your backend server's OAuth 2.0 client ID in the Google developer documentation. For details on how to fetch the ID token, see Authenticate with a back-end server.
Add A3L Authentication SDK to your project
Use these steps to add the A3L Authentication SDK to your project.
-
Download the A3L Authentication SDK.
The SDK includes the AAR file, the Javadocs, and samples apps (one for Java and one for Kotlin).
-
Add the AAR file to your project's libs folder and add the following information in the build.gradle file.
-
Add the A3L Authentication AAR file as a dependency:
implementation files('<Path to AAR>/A3LAuthentication-1.1.0.aar')
-
Add Google Sign-In and AppAuth as dependencies:
implementation 'com.google.android.gms:play-services-auth:20.7.0' implementation 'net.openid:appauth:0.11.1'
-
Add the following dependencies:
implementation 'com.squareup.okio:okio:3.2.0' implementation 'androidx.security:security-crypto:1.1.0-alpha06'
-
In the default configuration of the build.gradle file, add a manifest placeholder for
appAuthRedirectScheme
as shown in the following example. TheappAuthRedirectScheme
value indicates where A3L should redirect a user after they are authenticated through the browser.android { defaultConfig { ... manifestPlaceholders = [ 'appAuthRedirectScheme': 'com.googleusercontent.apps.<PREFIX>' ] } ... }
In your app, replace
<PREFIX>
in the preceding example with the first part of your app's client ID. Your client ID has the format<PREFIX>.apps.googleusercontent.com
. Don't include anything after<PREFIX>
in your build.gradle file. -
To access Google APIs through the
FOSAccountCredential
object, add the Google Auth Library dependency and updatepackagingOptions
to excludeMETA-INF/DEPENDENCIES
.implementation 'com.google.auth:google-auth-library-oauth2-http:1.20.0'
android { ... packagingOptions { resources.excludes += 'META-INF/DEPENDENCIES' } ... }
To make the app compatible with Fire OS devices, enable desugaring support provided by Android.
-
Next steps
See Integrate A3L Authentication SDK.
Last updated: Dec 05, 2023