Skip to content

Consider making TokenExtensions.UpdateTokenValue()'s tokenValue parameter nullable #62257

Open
@kevinchalet

Description

@kevinchalet

Summary

Likely due to an oversight, the tokenValue parameter exposed by the TokenExtensions.UpdateTokenValue() API isn't currently declared as a string?, even though this parameter is expected to be nullable (it's not null-guarded and it updates a dictionary entry for which values are deliberately nullable).

Motivation and goals

Fixing the signature would offer a better indication that the tokenValue parameter is actually nullable.

Risks / unknowns

This change only affects compilation (since nullable references are hints) and has no risk of runtime regression.

Examples

// Currently logs a CS8604 warning as `GetTokenValue()` returns a `string?`.
properties.UpdateTokenValue("refresh_token", result.Properties.GetTokenValue("refresh_token"));

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-authIncludes: Authn, Authz, OAuth, OIDC, Bearerdesign-proposalThis issue represents a design proposal for a different issue, linked in the descriptionhelp wantedUp for grabs. We would accept a PR to help resolve this issue

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions