{"templateId":"markdown","sharedDataIds":{},"props":{"metadata":{"markdoc":{"tagList":["InteractiveLink","Notification","CodeBlockCustom","CodeItem","LightboxImage"]},"type":"markdown"},"seo":{"title":"Android Kotlin quickstart","siteUrl":"https://developers.frontegg.com/","llmstxt":{"title":"Frontegg Developer Documentation","description":"Authentication, authorization, and user management for Customer Identity, plus Agen for SaaS and Agen for Work. Guides, SDKs, and API references.","sections":[{"title":"Customer Identity (CIAM)","description":"Auth, SSO, SCIM, entitlements, and user management — guides, SDKs, and APIs.","includeFiles":["ciam/**/*.md"],"excludeFiles":[]},{"title":"Agen for SaaS","description":"Agentic access and authorization for SaaS products.","includeFiles":["agen-for-saas/**/*.md"],"excludeFiles":[]},{"title":"Agen for Work","description":"Agentic access and authorization for internal and workforce use.","includeFiles":["agen-for-work/**/*.md"],"excludeFiles":[]},{"title":"Platform","description":"Shared platform overview.","includeFiles":["platform/**/*.md"],"excludeFiles":[]}],"excludeFiles":["internal-docs/**","ciam/guides/env-settings/inject-client-ip.md","CLAUDE.md",".claude/**","**/images/**"],"hide":false}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"android-kotlin-quickstart","__idx":0},"children":["Android Kotlin quickstart"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide is a walkthrough on how to integrate Frontegg’s authentication magic into your app using the Frontegg Android Kotlin SDK. Whether you need to add secure sign-ups, logins, multi-factor authentication, or even social logins, this guide has you covered with simple, step-by-step instructions to get things rolling in no time."]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"InteractiveLink","attributes":{"href":"https://github.com/frontegg/frontegg-android-kotlin","target":"_blank","justifyContent":"center"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Check out the sample package on GitHub"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Notification","attributes":{"title":"Prerequisites","type":"attention"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Frontegg Hosted Login is required, and setting a ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/ciam/guides/env-settings/custom-domain"},"children":["custom domain"]}," is highly recommended.",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Android ≥ 26",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Java ≥ 8"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Android SDK 26+"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set defaultConfig's minSDK to 26+ in build.gradle:"," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["Groovy","Kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"android {\n      defaultConfig {\n          minSdk 26\n      }\n  }\n"},"children":[]}]},{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"android {\n    defaultConfig {\n        minSdk = 26\n    }\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Java 8+"]}," ","Set target java 8 byte code for Android and Kotlin plugins respectively ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["build.gradle"]},":"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["Groovy","Kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"android {\n      compileOptions {\n          sourceCompatibility JavaVersion.VERSION_1_8\n          targetCompatibility JavaVersion.VERSION_1_8\n      }\n\n      kotlinOptions {\n          jvmTarget = '1.8'\n      }\n  }\n"},"children":[]}]},{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":" android {\n    compileOptions {\n        sourceCompatibility = JavaVersion.VERSION_1_8\n     \ttargetCompatibility = JavaVersion.VERSION_1_8\n  \t}\n\n    kotlinOptions {\n        jvmTarget = \"1.8\"\n    }\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"setup-for-gradle8","__idx":1},"children":["Setup for Gradle8+"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Enable ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["buildconfig"]}," feature:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add the below line to your gradle.properties:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["android.defaults.buildfeatures.buildconfig=true"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add the below lines to your app/build.gradle:"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["Groovy","Kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"android {\n    ...\n    buildFeatures {\n        buildConfig = true\n    }\n    ...\n}\n"},"children":[]}]},{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"android {\n    ...\n    buildFeatures {\n        buildConfig = true\n    }\n    ...\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"proguard-setup-optional","__idx":2},"children":["Proguard setup (optional)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["minifyEnabled"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shrinkResources"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},", follow the instruction below:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["Groovy","Kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"# Gson relies on generic type information stored in class files when working with fields. \n# ProGuard removes this information by default, so we need to retain it.\n-keepattributes Signature\n\n# according to https://stackoverflow.com/a/76224937\n# This is also required for R8 in compatibility mode, as several optimizations \n# (such as class merging and argument removal) may remove the generic signature.\n# For more information, see:\n# https://r8.googlesource.com/r8/+/refs/heads/main/compatibility-faq.md#troubleshooting-gson-gson\n-keep class com.google.gson.reflect.TypeToken { *; }\n-keep class * extends com.google.gson.reflect.TypeToken\n\n# Retain GSON @Expose annotation attributes\n-keepattributes AnnotationDefault,RuntimeVisibleAnnotations\n-keep class com.google.gson.reflect.TypeToken { <fields>; }\n-keepclassmembers class **$TypeAdapterFactory { <fields>; }\n\n# Keep Frontegg classes\n-keep class com.frontegg.android.utils.JWT { *; }\n-keep class com.frontegg.android.models.** { *; }\n\n# Retain Tink classes used for shared preferences encryption\n-keep class com.google.crypto.tink.** { *; }\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"prepare-frontegg-workspace","__idx":3},"children":["Prepare Frontegg workspace"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://portal.frontegg.com/development/settings"},"children":["Frontegg Portal Settings"]},", If you",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"don't have application follow integration steps after signing up. Copy ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggDomain"]}," for future steps",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"from ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://portal.frontegg.com/development/settings/domains"},"children":["Frontegg Portal Domain"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"LightboxImage","attributes":{"isLightbox":true},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/new-frontegg-domain.60f517108b4c93feb0326bd54894cfac97dcc0d10d29d12eb2cf4ef068816e5f.14341b2b.png","alt":"frontegg-domain"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"setup-hosted-login","__idx":4},"children":["Setup hosted login"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://portal.frontegg.com/development/authentication/hosted"},"children":["Login Method Settings"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Toggle on Hosted login method"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{{ANDROID_PACKAGE_NAME}}://{{FRONTEGG_BASE_URL}}/android/oauth/callback"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["(for custom scheme)"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://{{FRONTEGG_BASE_URL}}/oauth/account/redirect/android/{{ANDROID_PACKAGE_NAME}}"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["(for assetlinks)"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ANDROID_PACKAGE_NAME"]}," with your application identifier"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FRONTEGG_BASE_URL"]}," with your Frontegg base url, without ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["https"]},", i.e ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggDomain"]},"."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"add-frontegg-package-to-the-project","__idx":5},"children":["Add Frontegg package to the project"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open you project"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Find your app's build.gradle file"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add the following to your dependencies section:"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["Groovy","Kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"dependencies {\n    // Add the Frontegg Android Kotlin SDK\n    implementation 'com.frontegg.sdk:android:1.+'\n    // Add Frontegg observables dependency\n    implementation 'io.reactivex.rxjava3:rxkotlin:3.0.1'\n}\n"},"children":[]}]},{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"dependencies {\n    // Add the Frontegg Android Kotlin SDK\n    implementation (\"com.frontegg.sdk:android:LATEST_VERSION\")\n    // Add Frontegg observables dependency\n    implementation 'io.reactivex.rxjava3:rxkotlin:3.0.1'\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"configure-build-config-fields","__idx":6},"children":["Configure build config fields"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To set up your Android application on to communicate with Frontegg, you have to",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["buildConfigField"]}," property the gradle ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["android/app/build.gradle"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This property will store frontegg hostname (without https) and client id from previous step:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["Groovy","Kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"def fronteggDomain = \"FRONTEGG_DOMAIN_HOST.com\" // without protocol https://\ndef fronteggClientId = \"FRONTEGG_CLIENT_ID\"\n\nandroid {\n    defaultConfig {\n\n        manifestPlaceholders = [\n                \"package_name\"      : applicationId,\n                \"frontegg_domain\"   : fronteggDomain,\n                \"frontegg_client_id\": fronteggClientId\n        ]\n\n        buildConfigField \"String\", 'FRONTEGG_DOMAIN', \"\\\"$fronteggDomain\\\"\"\n        buildConfigField \"String\", 'FRONTEGG_CLIENT_ID', \"\\\"$fronteggClientId\\\"\"\n    }\n}\n"},"children":[]}]},{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"val fronteggDomain = \"FRONTEGG_DOMAIN_HOST.com\" // without protocol https://\nval fronteggClientId = \"FRONTEGG_CLIENT_ID\"\n\nandroid {\n    defaultConfig {\n\n        manifestPlaceholders[\"package_name\"] = applicationId.toString()\n        manifestPlaceholders[\"frontegg_domain\"] = fronteggDomain\n        manifestPlaceholders[\"frontegg_client_id\"] = fronteggClientId\n\n        buildConfigField(\"String\", \"FRONTEGG_DOMAIN\", \"\\\"$fronteggDomain\\\"\")\n        buildConfigField(\"String\", \"FRONTEGG_CLIENT_ID\", \"\\\"$fronteggClientId\\\"\")\n    }\n\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bundleConfig=true"]}," if not exists inside the android section inside the app gradle ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["android/app/build.gradle"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["Groovy","Kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"android {\n    buildFeatures {\n        buildConfig = true\n    }\n}\n"},"children":[]}]},{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"android {\n    buildFeatures {\n        buildConfig = true\n    }\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"multi-apps-support","__idx":7},"children":["Multi-apps support"]},{"$$mdtype":"Tag","name":"Notification","attributes":{"title":"Prerequisites","type":"attention"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The use of this feature requires minimum @frontegg/android-kotlin@1.2.19"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide outlines the steps to configure your Android application to support multiple applications."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Modify the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Build.gradle"]}," file"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["Groovy","Kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"def fronteggApplicationId = \"your-application-id-uuid\"\n...\nandroid {\n    ...\n    buildConfigField \"String\", 'FRONTEGG_APPLICATION_ID', \"\\\"$fronteggApplicationId\\\"\"\n}\n"},"children":[]}]},{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"val fronteggApplicationId = \"your-application-id-uuid\"\n...\nandroid {\n    ...\n    buildConfigField(\"String\", \"FRONTEGG_APPLICATION_ID\", \"\\\"$fronteggApplicationId\\\"\")\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Modify the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["App"]}," file"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BuildConfig"]},".",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FRONTEGG_APPLICATION_ID"]}," to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggApp"]},".",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["App.kt"]}," code:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"class App : Application() {\n\n    companion object {\n        lateinit var instance: App\n    }\n\n    override fun onCreate() {\n        super.onCreate()\n        instance = this\n        FronteggApp.init(\n            BuildConfig.FRONTEGG_DOMAIN,\n            BuildConfig.FRONTEGG_CLIENT_ID,\n            this,\n            BuildConfig.FRONTEGG_APPLICATION_ID, // here\n        )\n    }\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"set-permissions","__idx":8},"children":["Set permissions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["INTERNET"]}," permission to the app's manifest file."]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["xml"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<uses-permission android:name=\"android.permission.INTERNET\"/>\n<uses-permission android:name=\"android.permission.POST_NOTIFICATIONS\"/>\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"configure-android-ssetlinks","__idx":9},"children":["Configure Android ssetLinks"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configuring your Android ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AssetLinks"]}," is required for Magic Link authentication / Reset Password /",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Activate Account / login with IdPs."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To add your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AssetLinks"]}," to your Frontegg application, you will need to update in each of your",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"integrated Frontegg Environments the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AssetLinks"]}," that you would like to use with that Environment. Send a POST request to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.frontegg.com/vendors/resources/associated-domains/v1/android"]}," with the following payload:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["xml"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"{\n    \"packageName\": \"YOUR_APPLICATION_PACKAGE_NAME\",\n    \"sha256CertFingerprints\": [\"YOUR_KEYSTORE_CERT_FINGERPRINTS\"]\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each Android app has multiple certificate fingerprint, to get your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DEBUG"]}," sha256CertFingerprint you",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"have to run the following command:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["debug mode"]},", run the following command and copy the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SHA-256"]}," value"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["NOTE:"]}," make sure to choose the Variant and Config equals to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["debug"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["bash"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"./gradlew signingReport\n\n###################\n#  Example Output:\n###################\n\n#  Variant: debug\n#  Config: debug\n#  Store: /Users/davidfrontegg/.android/debug.keystore\n#  Alias: AndroidDebugKey\n#  MD5: 25:F5:99:23:FC:12:CA:10:8C:43:F4:02:7D:AD:DC:B6\n#  SHA1: FC:3C:88:D6:BF:4E:62:2E:F0:24:1D:DB:D7:15:36:D6:3E:14:84:50\n#  SHA-256: D9:6B:4A:FD:62:45:81:65:98:4D:5C:8C:A0:68:7B:7B:A5:31:BD:2B:9B:48:D9:CF:20:AE:56:FD:90:C1:C5:EE\n#  Valid until: Tuesday, 18 June 2052\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For Release mode, Extract the SHA256 using keytool from your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Release"]}," keystore file:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["bash"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"keytool -list -v -keystore /PATH/file.jks -alias YourAlias -storepass *** -keypass ***\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"multi-region-support","__idx":10},"children":["Multi-region support"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide outlines the steps to configure your Android application to support multiple regions."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Remove buildConfigFields from your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["build.gradle"]}," file:"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["Groovy","Kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"android {\n    //  remove this lines:\n    //  buildConfigField \"String\", 'FRONTEGG_DOMAIN', \"\\\"$fronteggDomain\\\"\"\n    //  buildConfigField \"String\", 'FRONTEGG_CLIENT_ID', \"\\\"$fronteggClientId\\\"\"\n}\n"},"children":[]}]},{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"android {\n    //  remove these lines:\n    //  buildConfigField(\"String\", \"FRONTEGG_DOMAIN\", \"\\\"$fronteggDomain\\\"\")\n    //  buildConfigField(\"String\", \"FRONTEGG_CLIENT_ID\", \"\\\"$fronteggClientId\\\"\")\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Modify the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["App"]}," file"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["First, adjust your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["App.kt/java"]}," file to handle multiple regions:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Modifications"]},":"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Remove"]}," the existing ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggApp.init"]}," function."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Add"]}," Call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggApp.initWithRegions"]}," with array of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["regions"]},". This array will hold",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"dictionaries for each region."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["App.kt"]}," code:"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"class App : Application() {\n\n    companion object {\n        lateinit var instance: App\n    }\n\n    override fun onCreate() {\n        super.onCreate()\n        instance = this\n\n        FronteggApp.initWithRegions(\n            listOf(\n                RegionConfig(\n                    \"eu\",\n                    \"auth.davidantoon.me\",\n                    \"b6adfe4c-d695-4c04-b95f-3ec9fd0c6cca\"\n                ),\n                RegionConfig(\n                    \"us\",\n                    \"davidprod.frontegg.com\",\n                    \"d7d07347-2c57-4450-8418-0ec7ee6e096b\"\n                )\n            ),\n            this\n        )\n    }\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":3},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AssetLinks"]}," for each region"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For each region, configuring your Android ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AssetLinks"]},". This is vital for proper API routing and",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"authentication. Follow ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"#config-android-assetlinks"},"children":["Config Android AssetLinks"]}," to add your Android domains to your",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Frontegg application."]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add Intent-Filter in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Manifest.xml"]}," ","The first domain will be placed automatically in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AndroidManifest.xml"]}," file. For each additional",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"region, you will need to add an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["intent-filter"]},". Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["${FRONTEGG_DOMAIN_2}"]}," with the second domain from the previous step."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["NOTE:"]}," if you are using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Custom Chrome Tab"]}," you have to use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["android:name"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["com.frontegg.android.HostedAuthActivity"]}," instead of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["com.frontegg.android.EmbeddedAuthActivity"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["xml"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<application>\n    <activity android:exported=\"true\" android:name=\"com.frontegg.android.EmbeddedAuthActivity\"\n              tools:node=\"merge\">\n        <intent-filter android:autoVerify=\"true\">\n            <action android:name=\"android.intent.action.VIEW\"/>\n\n            <category android:name=\"android.intent.category.DEFAULT\"/>\n            <category android:name=\"android.intent.category.BROWSABLE\"/>\n\n            <data android:scheme=\"https\"/>\n            <!-- DONT NOT COMBINE THE FOLLOWING LINES INTO ONE LINE-->\n            <data android:host=\"${FRONTEGG_DOMAIN_2}\"\n                  android:pathPrefix=\"/oauth/account/activate\"/>\n            <data android:host=\"${FRONTEGG_DOMAIN_2}\"\n                  android:pathPrefix=\"/oauth/account/invitation/accept\"/>\n            <data android:host=\"${FRONTEGG_DOMAIN_2}\"\n                  android:pathPrefix=\"/oauth/account/reset-password\"/>\n            <data android:host=\"${FRONTEGG_DOMAIN_2}\"\n                  android:pathPrefix=\"/oauth/account/login/magic-link\"/>\n        </intent-filter>\n    </activity>\n\n    <activity android:exported=\"true\" android:name=\"com.frontegg.android.AuthenticationActivity\"\n              tools:node=\"merge\">\n        <!-- DONT NOT COMBINE THE FOLLOWING FILTERS INTO ONE LINE-->\n        <intent-filter>\n            <action android:name=\"android.intent.action.VIEW\"/>\n\n            <category android:name=\"android.intent.category.DEFAULT\"/>\n            <category android:name=\"android.intent.category.BROWSABLE\"/>\n\n            <data android:host=\"${FRONTEGG_DOMAIN_2}\"\n                  android:pathPrefix=\"/${package_name}/android/oauth/callback\"\n                  android:scheme=\"https\"/>\n        </intent-filter>\n        <intent-filter>\n            <action android:name=\"android.intent.action.VIEW\"/>\n\n            <category android:name=\"android.intent.category.DEFAULT\"/>\n            <category android:name=\"android.intent.category.BROWSABLE\"/>\n\n            <data android:host=\"${FRONTEGG_DOMAIN_2}\" android:scheme=\"${package_name}\"/>\n        </intent-filter>\n    </activity>\n</application>\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":5},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Implement region relection UI"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The final step is to implement a UI for the user to select their region. **This can be done in any",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"way you see fit. The example application uses a simple picker view to allow the user to select their region."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Important Considerations"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Switching Regions"]},": To switch regions, update the selection in Shared Preferences. If issues",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"arise, a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["re-installation"]}," of the application might be necessary."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Isolation"]},": Ensure data handling and APIs are region-specific to prevent data leakage",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"between regions."]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"center","data-label":"Select EU Region"},"children":["Select EU Region"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"center","data-label":"Select US Region"},"children":["Select US Region"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"center"},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/eu-region-example.b43215d2a725f9b73d803a3ee90bb3e87c695825f8767a08e4c31e5477dac47c.14341b2b.gif","alt":"eu-region-example.gif"},"children":[]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"center"},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/us-region-example.ec48d044edc19e458a1bcabe98a0e8cc0e17cbf09a99ea37c0665d648456f715.14341b2b.gif","alt":"us-region-example.gif"},"children":[]}]}]}]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example Region Selection",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"UI: ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://github.com/frontegg/frontegg-android-kotlin/blob/master/multi-region/src/main/java/com/frontegg/demo/RegionSelectionActivity.kt"},"children":["example code"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"package com.frontegg.demo\n\nimport androidx.appcompat.app.AppCompatActivity\nimport android.os.Bundle\nimport android.widget.LinearLayout\nimport com.frontegg.android.FronteggApp\n\nclass RegionSelectionActivity : AppCompatActivity() {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContentView(R.layout.activity_region_selection)\n    }\n\n\n    override fun onResume() {\n        super.onResume()\n\n        val euButton = findViewById<LinearLayout>(R.id.euButton)\n        val usButton = findViewById<LinearLayout>(R.id.usButton)\n\n        euButton.setOnClickListener {\n            FronteggApp.getInstance().initWithRegion(\"eu\")\n            finish()\n        }\n\n        usButton.setOnClickListener {\n            FronteggApp.getInstance().initWithRegion(\"us\")\n            finish()\n        }\n    }\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"embedded-webview-vs-custom-chrome-tab","__idx":11},"children":["Embedded webview vs custom chrome tab"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Frontegg SDK supports two authentication methods:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Embedded Webview"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Custom Chrome Tab"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["By default Frontegg SDK will use Embedded Webview, to use Custom Chrome Tab you have to set remove",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"embedded activity by adding below code to",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"the application manifest:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["xml"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n          xmlns:tools=\"http://schemas.android.com/tools\">\n    <application>\n        <!-- ... -->\n\n        <activity android:name=\"com.frontegg.android.EmbeddedAuthActivity\"\n                  tools:replace=\"android:enabled\" android:enabled=\"false\"/>\n        <activity android:name=\"com.frontegg.android.HostedAuthActivity\"\n                  tools:replace=\"android:enabled\" android:enabled=\"true\"/>\n\n        <!-- ... -->\n    </application>\n</manifest>\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"initialize-fronteggapp","__idx":12},"children":["Initialize FronteggApp"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a custom ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["App"]}," class that extends ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["android.app.Application"]}," to initialize ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggApp"]},":"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"package com.frontegg.demo\n\nimport android.app.Application\nimport com.frontegg.android.FronteggApp\n\nclass App : Application() {\n\n    override fun onCreate() {\n        super.onCreate()\n\n        FronteggApp.init(\n            BuildConfig.FRONTEGG_DOMAIN,\n            BuildConfig.FRONTEGG_CLIENT_ID,\n            this, // Application Context\n        )\n    }\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Register the custom ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["App"]}," in the app's manifest file"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["AndroidManifest.xml:"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["xml"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<application android:name=\".App\">\n    <!--  ... -->\n</application>\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"enabling-chrome-custom-tabs-for-social-login","__idx":13},"children":["Enabling chrome custom tabs for social login"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To enable social login via Chrome Custom Tabs, set the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["useChromeCustomTabs"]}," flag to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," during the",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"initialization of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggApp"]},". By default, the SDK uses the Chrome browser for social login."]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"FronteggApp.init(\n      BuildConfig.FRONTEGG_DOMAIN,\n      BuildConfig.FRONTEGG_CLIENT_ID,\n      this, // Application Context\n      // ...\n      useChromeCustomTabs = true\n  )\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"login-with-frontegg","__idx":14},"children":["Login with Frontegg"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In order to login with Frontegg, you have to call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggAuth.instance.login"]}," method",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["activtity"]}," context. Login method will open Frontegg hosted login page, and will return user data after successful login."]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"import com.frontegg.android.FronteggAuth\n\nclass FirstFragment : Fragment() {\n    // ...\n\n    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {\n\n        binding.loginButton.setOnClickListener {\n            FronteggAuth.instance.login(requireActivity())\n        }\n    }\n    // ...\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"logout-user","__idx":15},"children":["Logout user"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In order to logout user, you have to call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggAuth.instance.logout"]}," method.",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Logout method will clear all user data from the device."]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"import com.frontegg.android.FronteggAuth\n\nclass FirstFragment : Fragment() {\n    // ...\n\n    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {\n\n        binding.logoutButton.setOnClickListener {\n            FronteggAuth.instance.logout()\n        }\n    }\n    // ...\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"switch-users-tenant","__idx":16},"children":["Switch user's tenant"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In order to switch tenant, you have to call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggAuth.instance.switchTenant"]}," method",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["activity"]}," context."]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"import com.frontegg.android.FronteggAuth\n\nclass FirstFragment : Fragment() {\n    // ...\n\n    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {\n\n        val tenantIds = FronteggAuth.instance.user.value?.tenantIds ?: listOf()\n\n        /**\n         *  pick one from `tenantIds` list:\n         */\n        val tenantToSwitchTo = tenantIds[0]\n\n        binding.switchTenant.setOnClickListener {\n            FronteggAuth.instance.switchTenant(tenantToSwitchTo)\n        }\n    }\n    // ...\n}\n"},"children":[]}]}]}]},"headings":[{"value":"Android Kotlin quickstart","id":"android-kotlin-quickstart","depth":2},{"value":"Setup for Gradle8+","id":"setup-for-gradle8","depth":3},{"value":"Proguard setup (optional)","id":"proguard-setup-optional","depth":3},{"value":"Prepare Frontegg workspace","id":"prepare-frontegg-workspace","depth":3},{"value":"Setup hosted login","id":"setup-hosted-login","depth":3},{"value":"Add Frontegg package to the project","id":"add-frontegg-package-to-the-project","depth":3},{"value":"Configure build config fields","id":"configure-build-config-fields","depth":3},{"value":"Multi-apps support","id":"multi-apps-support","depth":3},{"value":"Set permissions","id":"set-permissions","depth":3},{"value":"Configure Android ssetLinks","id":"configure-android-ssetlinks","depth":3},{"value":"Multi-region support","id":"multi-region-support","depth":3},{"value":"Embedded webview vs custom chrome tab","id":"embedded-webview-vs-custom-chrome-tab","depth":3},{"value":"Initialize FronteggApp","id":"initialize-fronteggapp","depth":3},{"value":"Enabling chrome custom tabs for social login","id":"enabling-chrome-custom-tabs-for-social-login","depth":3},{"value":"Login with Frontegg","id":"login-with-frontegg","depth":3},{"value":"Logout user","id":"logout-user","depth":3},{"value":"Switch user's tenant","id":"switch-users-tenant","depth":3}],"frontmatter":{"seo":{"title":"Android Kotlin quickstart"}},"lastModified":"2025-11-04T13:25:50.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ciam/sdks/mobile/android-kotlin/login-old","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}