Closed Ranbir-Sinha closed 3 years ago
It happened because "offline_access" was not present in the scope. Without this scope, app cannot receive refresh token and the access token usually expires in one hour. Refresh tokens are long-lived. The app can get new access tokens as older ones expire.
Add "offline_access" in the scope and get admin consent for this scope in the Azure app registration.
The OAuth2 SSO implementation works perfectly with "@EnableOAuth2Sso" but after an hour of activity, the token expires and the OAuth2RestTemplate is unable to refresh access token, resulting in the following exception.
I tried few suggestion listed on stackoverflow (related to filter registration) and here but none of them worked.
Do you have a solution to this problem?