{"templateId":"markdown","sharedDataIds":{},"props":{"metadata":{"markdoc":{"tagList":["CodeBlockCustom","CodeItem"]},"type":"markdown"},"seo":{"title":"Android Kotlin advanced setup","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-advanced-setup","__idx":0},"children":["Android Kotlin advanced setup"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In this guide, you'll find an overview and best practices for enabling advanced features and using built in functions for biometric authentication (passkeys) and step-up."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"passkeys-authentication","__idx":1},"children":["Passkeys authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Passkeys enable seamless, passwordless login with biometric authentication and WebAuthn. Follow these steps to integrate them manually using Frontegg's APIs."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Prerequisites"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["Kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"dependencies {\n    implementation(\"androidx.browser:browser:1.8.0\")\n}\n","lang":"kotlin"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Register Passkey:"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["Kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"FronteggAuth.instance.registerPasskeys(activity!!) { error ->\n    if (error != null) {\n        Log.e(\"FronteggAuth\", \"Failed to register passkey: $error\")\n    } else {\n        Log.i(\"FronteggAuth\", \"Passkey registered successfully\")\n    }\n}\n","lang":"kotlin"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Login with passkey:"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["Kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"FronteggAuth.instance.loginWithPasskeys(activity!!) { error ->\n    if (error != null) {\n        Log.e(\"FronteggAuth\", \"Failed to login with passkey: $error\")\n    } else {\n        Log.i(\"FronteggAuth\", \"Logged in successfully with passkey\")\n    }\n}\n","lang":"kotlin"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-up-authentication","__idx":2},"children":["Step-up authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Step-up authentication is a security feature that temporarily elevates a user's authentication level to perform sensitive actions, such as accessing personal data, making transactions, or changing security settings."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide describes how to use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["isSteppedUp"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["stepUp"]}," methods in your Android application to ensure that your app handles sensitive actions securely by checking authentication status and prompting for re-verification only when necessary."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Please follow ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://developers.frontegg.com/guides/step-up/intro"},"children":["this guide"]}," for more details."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"stepup--","__idx":3},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["stepUp"]}," -"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Triggers the step-up authentication process. Typically involves MFA or other user verification."]},{"$$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":"FronteggAuth.instance.stepUp(\n    activity = this,\n    maxAge = Duration.ofMinutes(5)\n) { error ->\n    if (error != null) {\n// Handle authentication failure\n        Log.e(\"StepUp\", \"Authentication failed\", error)\n    } else {\n// Authentication succeeded, continue with sensitive action\n        performSecureOperation()\n    }\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["activity"]},": The current Android Activity instance."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["callback"]},": A callback that receives an Exception if something goes wrong."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["maxAge"]}," (optional): Same as in isSteppedUp, defines how long the step-up remains valid."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"issteppedup--","__idx":4},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["isSteppedUp"]}," -"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This method whether the user has already completed a step-up authentication and is allowed to proceed."]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["Kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"val isSteppedUp = FronteggAuth.instance.isSteppedUp(maxAge = Duration.ofMinutes(5))\n\nif (isSteppedUp) {\n// Proceed with sensitive operation\n} else {\n// Trigger step-up\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example"]},":"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["Kotlin"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"fun onSecureActionClicked() {\n  if (FronteggAuth.instance.isSteppedUp(maxAge = Duration.ofMinutes(5))) {\n    performSecureOperation()\n  } else {\n    FronteggAuth.instance.stepUp(this, Duration.ofMinutes(5)) { error ->\n      if (error == null) {\n        performSecureOperation()\n      } else {\n        Toast.makeText(this, \"Step-up failed: ${error.message}\", Toast.LENGTH_LONG).show()\n      }\n    }\n  }\n}\n\nfun performSecureOperation() {\n// Execute the action that requires elevated authentication\n}\n"},"children":[]}]}]}]},"headings":[{"value":"Android Kotlin advanced setup","id":"android-kotlin-advanced-setup","depth":2},{"value":"Passkeys authentication","id":"passkeys-authentication","depth":2},{"value":"Step-up authentication","id":"step-up-authentication","depth":2},{"value":"stepUp -","id":"stepup--","depth":3},{"value":"isSteppedUp -","id":"issteppedup--","depth":3}],"frontmatter":{"seo":{"title":"Android Kotlin advanced setup"}},"lastModified":"2025-11-04T13:25:50.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ciam/sdks/mobile/android-kotlin/advanced-old","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}