82849

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?

Answer1:

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.

Recommend

  • how to add listview in listview in android?
  • Using DI in ConfigureService-Methods (especially IApplicationLifetime) in .NET Core
  • UWP XAML ImageBrush.imageSource from networkshare
  • Why __weak object will be added to autorelease pool?
  • Javascript delete cookie before reload or redirect
  • No resource found that matches the given name: attr 'homeHint'
  • How can a console application sudo itself under OS X if it needs root privileges? [closed]
  • Two ways to execute a Stored procedure in VBA, Which one is better?
  • How to remove just the index name and not the content in Pandas multiindex data frame
  • InputDispatcher Error
  • Nginx raises 404 when using format => 'js'
  • How can I stop .htaccess redirecting a subdomain to the main site?
  • How to Cache Images Dynamically-Generated with PHP?
  • Programmatically check if PHP is installed using Python
  • PHP exec response as string?
  • Pass nested C++ vector as built-in style multi-dimensional array
  • Xamarin iOS debugger not hitting breakpoints
  • How do you keep a running instance for Google App Engine
  • Uber API - requests endpoint cannot read read json
  • WordPress > setting permalink option via script buggy?
  • Is it possible to access block's scope in method?
  • Meteor helpers not available in Angular template
  • Debugging ASP.NET on a built-in web server suddenly stops
  • Dynamically accessing properties of knockoutjs observable array
  • Jenkins: How To Build multiple projects from a TFS repository?
  • Fetching methods from BroadcastReceiver to update UI
  • Sony Xperia Z Tablet not found by adb
  • Does CUDA 5 support STL or THRUST inside the device code?
  • SSO with signing and signature validation doesn't work
  • ILMerge & Keep Assembly Name
  • How to make Safari send if-modified-since header?
  • Large data - storage and query
  • How can I estimate amount of memory left with calling System.gc()?
  • WOWZA + RTMP + HTML5 Playback?
  • Revoking OAuth Access Token Results in 404 Not Found
  • Hits per day in Google Big Query
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • File not found error Google Drive API
  • How can I remove ASP.NET Designer.cs files?
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]