Hyphen
  • Hyphen
  • Concepts
    • Auth Methods
    • Hyphen Multi-Sig Account
      • Device Key
      • Recovery Key
      • Server Key
    • Paymaster
    • Hybrid Custody
  • Mechanism Paper
  • iOS SDK
    • Quick Start
    • Authenticating Users
    • Using Hyphen UI Kit
      • Account Management Screen
    • Sample Project
  • Android SDK
    • Quick Start
    • Authenticating Users
    • Handling 2FA / Transaction Request
    • Using Hyphen UI Kit
    • Sending Transactions
  • Flutter SDK
    • Quick Start
    • Authenticating Users
    • Using Hyphen UI Kit
    • Sending Transactions
    • Example App
  • Hybrid Custody
    • Into the Hybrid Custody
  • Without Using SDK
    • Authenticating Users
    • Handling 2FA Push
  • REST API
    • API Reference
      • Account
      • Auth
      • Device
      • Key
      • Sign
    • Swagger
Powered by GitBook
On this page
  • Integrate Hyphen Authenticate
  • Implementation HyphenAuthenticateDelegate
  • Authenticate with Google Account
  • Get Hyphen Account

Was this helpful?

  1. Android SDK

Authenticating Users

Use HyphenAuthenticate to sign in users

PreviousQuick StartNextHandling 2FA / Transaction Request

Last updated 1 year ago

Was this helpful?

Hyphen Authentication are provided in the module of the SDK. You can sign in, create an account, or get the user's key and account information through this module.

Recovery Key Support for Android SDK is Currently in Beta

As the SDK uses Google Play Credential Store to store recovery keys, it is required for the app to be published on Play Store in order to use the feature. If you want to access the feature, please feel free to reach out to !

Integrate Hyphen Authenticate

Implementation HyphenAuthenticateDelegate

You must implement the HyphenAuthenateDelegate interface from Activity class where you want to use Hyphen authentication.

class YourActivity: AppCompatActivity,  {
    
    // HyphenAuthenticateDelegate
    override var hyphenAuthenticateActivityResultLauncher: ActivityResultLauncher<Intent> =
        (this as ComponentActivity).registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
            hyphenActivityResultCallback?.invoke(it)
        }

    // IMPORTANT: you must set null this value.
    override var hyphenActivityResultCallback: ((ActivityResult) -> Unit)? = null
}

Authenticate with Google Account

Currently, Hyphen SDK only support Google Account.

HyphenAuthenticate.authenticate(
    activity = activityContext,
    webClientId = "<YOUR-WEB-CLIENT-ID>" // ex. 201778913659-dn4bo82q6hce3kfp7vstp04b22nh5hbi.apps.googleusercontent.com
)

Get Hyphen Account

In authenticate successfully, you can get hyphen account.

val hyphenAccount = HyphenAuthenticate.getAccount(context = activityContext) // return object: 
Log.e(hyphenAccount.addresses.first().address) // print "0x<FLOW_ADDRESS>"

You must use the Web Client ID on the Google Cloud Platform for Google Authentication. See also .

at.hyphen:android-sdk-authenticate
jun@meowauth.xyz
Get your Google API client ID