How to recover from a Spring Social ExpiredAuthorizationException

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?

Answers


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.


Need Your Help

Open a file in the browser from Silverlight

file browser silverlight-4.0

I have a Button (or a hyperlinkbutton) in Silverlight. I want to open a file on a server share when this butto in clicked. With other words I want a new Browser Tab or Window to open showing the

Fill in excel spreadsheet with randomised data using C#

c# excel

I want to fill in a spreadsheet that is directly linked to a C# application.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.