openid / AppAuth-Android

Android client SDK for communicating with OAuth 2.0 and OpenID Connect providers.
https://openid.github.io/AppAuth-Android
Apache License 2.0
2.84k stars 884 forks source link

Is possible to use prompt=none to check state of session? #446

Open jtn-d opened 5 years ago

jtn-d commented 5 years ago

I am trying to check if a user is still logged in by repeating the authentication request with prompt=none, see Session Status Change Notification.

There is setPrompt(AuthorizationRequest.Prompt.NONE) method, but when I am using it, the redirect is failing. Am I missing something?

iainmcgin commented 5 years ago

Generally speaking, you won't be able to use AppAuth's approach to authorization via a custom tabs or system browser for "background" checks like this, for two reasons:

jtn-d commented 5 years ago

"Browsers will not allow redirects back to the app without user interaction" I don't think there is need for user interaction, because I have logout procedure working without any interaction from user. The app uses CustomTabsIntent to launch end_session_endpoint and IdP redirects successfully back.

iainmcgin commented 5 years ago

What is the difference between your implementation that works, and what AppAuth is doing? If we had a way to reliably deliver redirects back to the app without user interaction I'd gladly take it, but our experience so far has been that redirects without user interaction are blocked by Chromium based browsers.

jtn-d commented 5 years ago

CustomTabsIntent.Builder().build().launchUrl(context, Uri.parse("$endSessionEndpoint?post_logout_redirect_uri=$logoutRedirectUri"))