Skip to content
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

Merged
merged 3 commits into from
May 3, 2021
Merged

Conversation

lbalmaceda
Copy link
Contributor

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
2021-04-30 at 11 32 35 - Salmon Pony

Tested running the following command in the terminal

adb shell am start -a android.intent.action.VIEW -d "demo://lbalmaceda.auth0.com/android/com.auth0.android.lock.app/email\?code\=145604"

See #620

@lbalmaceda lbalmaceda added the review:small Small review label Apr 30, 2021
@lbalmaceda lbalmaceda added this to the Major - v3 milestone Apr 30, 2021
@lbalmaceda lbalmaceda requested a review from a team as a code owner April 30, 2021 10:04
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when you start a passwordless flow and ask for "android_link" this is the format of callback URL that the server will use. This is not changeable by the developer.

The server takes the domain from the Auth0 application and the Android package name from this setting:
image

@@ -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">
Copy link
Contributor Author

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">
Copy link
Contributor Author

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" />
Copy link
Contributor Author

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.

@lbalmaceda lbalmaceda enabled auto-merge (rebase) May 3, 2021 09:12
@lbalmaceda lbalmaceda merged commit be4f37d into v3 May 3, 2021
@lbalmaceda lbalmaceda deleted the feat-applinks branch May 3, 2021 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants