AD FS set up on Windows Server 2022 Standard and version 10.0.20348 Build 20348 failed to go through Authentication API "Refresh_Token" grant_type
Set up a .net application which based on the following details:
a) AD FS on Windows Server 2022 Standard and version 10.0.20348 Build 20348.
b) Application run on Dotnet hosting bundle 6.0.21 Windows version.
Errors:
With PKCE Authentication flow, the behaviours of SSO login processes as:
- First, authorization_code Grant_Type API was successful.
Request URL: https://<<domain>>/adfs/oauth2/token/
Request Method: POST
Status Code: 200 OK
Remote Address: <<ip>>:443
Referrer Policy: strict-origin-when-cross-origin
Form Data:
client_id: <<client_id>>
redirect_uri: https://<<appdomain>>/index.html
scope: User.Read openid profile offline_access
code: <<code>>
x-client-SKU: msal.js.browser
x-client-VER: 2.37.0
x-ms-lib-capability: retry-after, h429
x-client-current-telemetry: 5|865,0,,,|@azure/msal-react,1.5.7
x-client-last-telemetry: 5|0|||0,0
code_verifier: <<code_verifier>>
grant_type: authorization_code
client_info: 1
client-request-id: <<client-request-id>>
Response:
{
"access_token": "<<access token>>",
"token_type": "bearer",
"expires_in": 3600,
"resource": "<<resource>>",
"refresh_token": "<<refresh token>>",
"refresh_token_expires_in": 28800,
"scope": "profile openid",
"id_token": "<<id token>>"
}
2) Second, Refresh_Token Grant type return 400 Bad Request
Request URL: https://<<domain>>/adfs/oauth2/token/
Request Method: POST
Status Code: 400 Bad Request
Remote Address: <<ip>>:443
Referrer Policy: strict-origin-when-cross-origin
Form Data:
client_id: <<client_id>>
scope: User.Read openid profile offline_access
grant_type: refresh_token
client_info: 1
x-client-SKU: msal.js.browser
x-client-VER: 2.37.0
x-ms-lib-capability: retry-after, h429
x-client-current-telemetry: 5|865,0,,,|@azure/msal-react,1.5.7
x-client-last-telemetry: 5|0|||0,0
client-request-id: <<client-request-id>>
refresh_token: <<refresh token>>
X-AnchorMailbox: Oid:<<value>>
Response:
{
"error": "invalid_grant",
"error_description": "MSIS9614: The refresh token received in \u0027refresh_token\u0027 parameter is invalid."
}
Why the refresh_token Authentication API call was 400 Bad request? Any configuration is needed to fix the error? I have this error in the Client Application installation but my local duplicated application installation was working fine. Please advise. Thanks in advance. Jade.