-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable AppLinks in the declared intent filters #622
Conversation
If you plan to use Passwordless authentication with SMS or Email connections, the Callback URL you will register looks like this: | ||
|
||
``` | ||
https://{YOUR_AUTH0_DOMAIN}/android/{YOUR_APP_PACKAGE_NAME}/sms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -9,8 +9,8 @@ | |||
<activity | |||
android:name="com.auth0.android.provider.RedirectActivity" | |||
tools:node="replace"> | |||
<intent-filter> | |||
<action android:name="android.intent.action.VIEW" /> | |||
<intent-filter android:autoVerify="true"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if inherited from the SDK declaration of this same activity, I rather am sure I'm setting it to true.
@@ -37,21 +37,21 @@ | |||
android:launchMode="singleTask" | |||
android:screenOrientation="portrait" | |||
android:theme="@style/Lock.Theme"> | |||
<intent-filter> | |||
<action android:name="android.intent.action.VIEW" /> | |||
<intent-filter android:autoVerify="true"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for passwordless activities, this affects LINK mode
|
||
<category android:name="android.intent.category.DEFAULT" /> | ||
<category android:name="android.intent.category.BROWSABLE" /> | ||
|
||
<data | ||
android:host="${auth0Domain}" | ||
android:pathPrefix="/android/${applicationId}/email" | ||
android:scheme="${auth0Scheme}" /> | ||
android:scheme="https" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the scheme is not customizable anywhere (API nor dashboard), so there's no reason to dynamically set one.
Changes
This aligns with what the SDK does. By setting the
autoVerify
attribute to true, and only when the scheme used is "https", upon install time, the Android OS will attempt to pull the assetlinks hosted file from the Auth0 server in order to verify that the domain given in the intent-filters is owned by the developer of the android app. When this succeeds, the disambiguation dialog will not be shown, and the application will be opened directly. This only works for Android 23 and above.Having this attribute enabled for when the scheme is not "https" or when the android version is lower than 23, has no negative effect.
Sample logging in with Passwordless Link
Tested running the following command in the terminal
See #620