-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add WebAuth Logout feature #245
Conversation
auth0/src/main/java/com/auth0/android/provider/LogoutManager.java
Outdated
Show resolved
Hide resolved
auth0/src/main/java/com/auth0/android/provider/WebAuthProvider.java
Outdated
Show resolved
Hide resolved
3b88678
to
c92ffe4
Compare
c92ffe4
to
78ee686
Compare
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, just a few comments/suggestions around method names and the callback handler params.
auth0/src/main/java/com/auth0/android/provider/LogoutManager.java
Outdated
Show resolved
Hide resolved
auth0/src/main/java/com/auth0/android/provider/WebAuthProvider.java
Outdated
Show resolved
Hide resolved
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.
Make sure you're following the docs styleguide for "logout" and "log out:"
https://github.com/auth0/docs/blob/master/STYLEGUIDE.md#vocabulary
All this makes me wonder if we want to expose the onFailure method or just expose the onSuccess method when we're confident that the returnTo URL was called because the user did log out.
Seems like there are enough conditions for failure that you would want to allow catching that. IMHO.
auth0/src/main/java/com/auth0/android/provider/WebAuthProvider.java
Outdated
Show resolved
Hide resolved
auth0/src/main/java/com/auth0/android/provider/WebAuthProvider.java
Outdated
Show resolved
Hide resolved
auth0/src/test/java/com/auth0/android/provider/LogoutManagerTest.java
Outdated
Show resolved
Hide resolved
0577358
to
608bde6
Compare
Changes
This PR adds a static builder to launch a call to the
/v2/logout
endpoint.Users can customize the scheme of the
returnTo
URL, and the Chrome Custom Tabs customization options, although TBH the process is quite fast and you barely notice the browser was open.Usage
Callback
The call can
returnTo
URL and in turn, re-opens the user application.The log out URL will always include the
client_id
parameter. So thereturnTo
URL must be whitelisted in the application allowed logout URLs section on the dashboard. More info in auth0 docs.References
Testing
Added a bunch of tests for the introduced changes.
Will probably rename some of the previous tests as now we share 2 flows (auth / logout) on the same
WebAuthProvider
class. (On a different PR)This change adds unit test coverage
This change adds integration test coverage
This change has been tested on the latest version of the platform/language or why not
Checklist
I have read the Auth0 general contribution guidelines
I have read the Auth0 Code of Conduct
All existing and new tests complete without errors