Skip to content

Conversation

@yowl
Copy link

@yowl yowl commented Jan 14, 2026

Fixes #5618

Changes proposed in this request
When refreshing a token, PingIdentity does not return the home account. This change takes the home account from the request if existing places do not supply it.

Testing
Added a test for the TokenCache for the PingIdentity scenario I face.

Performance impact
None done, minor impact of and extra ?? when there is no ID/client_info returned.

Documentation
This is a PR to fix an issue with the experimental feature of using an OIDC that is not Azure, namely PingIdentity. When getting a refresh token, the client_info is not returned, and nor is a new identity token. I believe that according to the spec these are optional so seems a valid scenario. In this case to get the right cache key the home account is taken from the request. If that is not present we will be back to a NRE again, but at least for PingIdentity we seem to be able to refresh tokens.

First PR here, so hopefully this is at least food for thought, if it is not the right approach.

Thanks for looking.

@yowl yowl requested a review from a team as a code owner January 14, 2026 21:58
{
ClientInfo clientInfo = response.ClientInfo != null ? ClientInfo.CreateFromJson(response.ClientInfo) : null;
string homeAccountId = clientInfo?.ToAccountIdentifier() ?? idToken?.Subject; // ADFS does not have client info, so we use subject
string homeAccountId = clientInfo?.ToAccountIdentifier() ?? idToken?.Subject ?? requestParams.Account.HomeAccountId.Identifier; // ADFS does not have client info, so we use subject
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if requestParams.Account is null etc, protect against Null refs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] ArgumentNullException when attempting to obtain a refresh token with Ping Identity.

2 participants