-
Notifications
You must be signed in to change notification settings - Fork 213
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
Fixed authentication restart when the app is minimized [SDK-2199] #350
Conversation
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.
Changes look good, a few questions to resolve. Also, let's add a dedicated section on the top of the README with guidance on how to set up the SDK with these changes. If I'm using the previous version, what changes do I need to make to support this? Is it optional or am I forced to use and declare these new activities in the android manifest?
@Widcket skipping this PR from 2.8.0 release's contents as this one contains a breaking change. I'll move it to vNext |
Hi! Any chance to expedite getting this to an official version of react-native-auth0? It is a required fix to a critical issue, at least in the way we implement authentication on Android. At the moment we're thus forced to lock react-native-auth0 to a certain commit instead of the official package version to have this fix included. |
@nlindroos I expect to pick this up next week, because we'll be changing the implementation a bit. |
@lbalmaceda the PR has been updated to use intent placeholders. The README has been updated as well, please check the messaging. Screen.Recording.2021-06-16.at.19.23.48.mov |
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.
Looks good, I left a few comments. Should we add the before/after snippets for the build.gradle and the manifest files, maybe using diff syntax, to highlight the changes required after this breaking change?
I can point out to the actual commit with the changes on the RN app, but that would need to be after the SDK is released. So: |
What if I want to continue to use |
Can |
Hi @Bardiamist, you can add a string resource file and reference the domain value like this: If you keep the Screen.Recording.2021-06-24.at.11.00.03.mov |
Changes
The authentication with the SDK breaks when the screen is minimized and the application is resumed from the application icon. This PR fixes this bug by decoupling the authentication into two activities:
AuthenticationActivity
: encapsulates the logic to launch the Custom Tabs intent, and pass the result back.RedirectActivity
: receives the callback URL (via an intent filter), clears the Custom Tabs activity from the stack and passes the callback URL to theAuthenticationActivity
.Both Activity definitions are provided by the SDK. Since the
RedirectActivity
uses intent placeholders, the app must provide the values in the app'sbuild.gradle
file:THIS IS A BREAKING CHANGE.
Testing
This change was tested manually on an emulator running Android 7.1.1.
Checklist