Open ID connect for native applications, i need get a valid ID token without prompting the user after the initial authorization?

拟墨画扇 提交于 2019-12-11 10:45:05

问题


I'm using the system browser for authentication. Identity Provider - Google

Steps

1 - user gets authorized by entering user name and password. I get the authentication_code at this point.

2 - I call the token end point and get access token, id token and refresh token.

When the ID token expires, I need to get a new valid ID token. I need to do this without prompting the user to enter a his credentials.

Question - Is it possible to get a new id token without prompting the user? Refresh token does not always return an ID token and its not a guaranteed behavior according to the open id specification

Tried Solution

Calling the authorization end point with "prompt=none,login_hint=username". This still redirects to the browser and comes back to the app.

Responses with an error

AuthorizationException: {"type":1,"code":1008,"error":"interaction_required"}


回答1:


prompt=none is the way to go; when you receive interaction_required it means that the session at the Provider expired and the user needs to login again; there's no way around that since you really need to authenticate the user again to prevent abuse. If the SSO session was still valid - which it should be for a short period of time - you would have received your new id_token.



来源:https://stackoverflow.com/questions/45096255/open-id-connect-for-native-applications-i-need-get-a-valid-id-token-without-pro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!