How to recover from a Spring Social ExpiredAuthorizationException

别说谁变了你拦得住时间么 提交于 2019-12-11 01:34:46

问题


I am trying to implement Google Oauth2 with Spring Social and spring-social-google. Initial authentication works fine. However after some time the authentication expires and I am hit by

org.springframework.social.ExpiredAuthorizationException: The authorization has expired.

How can you recover from this exception? Is it possible to somehow refresh the authorization?


回答1:


Try to send additional access_type=offline paramter during authorization. It may looks something like this:

<form ...>
    .....
    <input type="hidden" name="access_type" value="offline"/>
</form>

Normally in this case authorization will be refreshed automatically for you. See this entry for more details.



来源:https://stackoverflow.com/questions/16358067/how-to-recover-from-a-spring-social-expiredauthorizationexception

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