0
votes

Azure AD is granting my application access tokens and a refresh token. When I use the refresh token to get a new access token, in return I get a new access token and a NEW refresh token.

Azure AD does not specify like Google Suite how many refresh tokens are allowed. But to the root of the problem, I don't want a refresh token being recreated and sent back, every time I use a refresh token. What is happening here? How do I stop this?

2
… why don't you want a new refresh token? - Hong Ooi
Why do I want a new refresh token? I don't want multiple refresh tokens floating around that take 90 days of inactivity to become blacklisted. - mfs_1990

2 Answers

2
votes

Returning of new refresh token is part of the OpenID Connect Protocol Specification which references the OAuth Authorization Framework section 5.1 for clarity.

Indeed the return of a refresh token is optional, but the implementation in Azure AD is so that it always returns a refresh token. I personally see no issue with it. Just throw away the last saved refresh token and keep the new one you got.

2
votes

You cannot control this, it is done by design. It is also in complience with the OAuth 2.0 spec:

The authorization server authenticates the client and validates the refresh token, and if valid, issues a new access token (and,optionally, a new refresh token).

As for "floating out there", this only happens if you make it happen. If your app "forgets" the old refresh token then it is gone.