Angular-auth-oidc-client: Silent refresh token renew does not work

Created on 4 Mar 2021  路  6Comments  路  Source: damienbod/angular-auth-oidc-client

Describe the bug
The token is never renewed, the first time tries to renew and raises an error.

To Reproduce
Silent refresh token renw

Expected behavior
It should refresh the token

Screenshots
image

Additional context
I am using the example AzureAD-Auth-MyUI-with-MyAPI to reproduce the issue and the silent token refresh does not work

question

Most helpful comment

Setting ignoreNonceAfterRefresh: true as you suggested worked.

Thanks a lot for your assistance.

I will play around with my Azure setup to find an explanation about why it was not working.

All 6 comments

The error says interaction required which means you are not logged in on the STS. If you are not logged in, then you can cannot refresh.

Greetings Damien

I am logged in, and everything works properly until the token has to be refreshed silently.
image

@Manuel-Moya Azure, this could be an Azure iframe problem as well. Can you try using refresh tokens?

Here's an example:

https://github.com/damienbod/AzureADAuthRazorUiServiceApiCertificate/blob/main/AngularAzureADMultipleApis/AngularAzureAD/src/app/app.module.ts#L19-L31

@damienbod I have just tried using refresh tokens, but once the token has to be refreshed, it fails.

image

This is a validation problem , disable the nonce validation for the refresh. You can see that the refresh has worked, but the client validation has failed.

Add this to your config:

ignoreNonceAfterRefresh: false

Don't now why I don't need this, just tested this with my Azure setup

Setting ignoreNonceAfterRefresh: true as you suggested worked.

Thanks a lot for your assistance.

I will play around with my Azure setup to find an explanation about why it was not working.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xaviergxf picture xaviergxf  路  3Comments

revok picture revok  路  4Comments

jhossy picture jhossy  路  4Comments

sdev95 picture sdev95  路  3Comments

vit100 picture vit100  路  4Comments