Lock.Android
library.
You can achieve a similar result by sending a link that the user can click to finish the passwordless authentication automatically, but a few more configuration steps are involved.
In order to be able to authenticate the user, your application must have the Email/SMS connection enabled and configured in your Auth0 Dashboard.
app/build.gradle
file add the Manifest Placeholders for the Auth0 Domain and the Auth0 Scheme properties, which are going to be used internally by the library to register an intent-filter that captures the authentication result.
strings.xml
file as string resources that can be referenced later from the code.
Auth0
with your application’s information. The easiest way to create it is by passing an Android Context. This will use the values previously defined in the strings.xml
file. For this to work, the string resources must be defined using the same keys as the ones listed above.
AuthenticationCallback
implementation that will handle user authentication events. The Credentials
object returned in successful authentication scenarios will contain the tokens that your application or API will end up consuming. See Tokens for more specifics.
onDestroy
method.
The sample below calls the useCode()
method to make Lock send a CODE to the user’s email or phone number.
PasswordlessLock
widget from inside your activity.