Skip to content

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

@kevinchalet

Description

@kevinchalet
Contributor

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"));

Activity

added
design-proposalThis issue represents a design proposal for a different issue, linked in the description
on Jun 5, 2025
added
needs-area-labelUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically
on Jun 5, 2025
added
area-authIncludes: Authn, Authz, OAuth, OIDC, Bearer
and removed
needs-area-labelUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically
on Jun 5, 2025
added
help wantedUp for grabs. We would accept a PR to help resolve this issue
on Jun 9, 2025
dotnet-policy-service

dotnet-policy-service commented on Jun 9, 2025

@dotnet-policy-service
Contributor

Looks like this issue has been identified as a candidate for community contribution. If you're considering sending a PR for this issue, look for the Summary Comment link in the issue description. That comment has been left by an engineer on our team to help you get started with handling this issue. You can learn more about our Help Wanted process here

added theissue type on Jun 9, 2025
added this to the Backlog milestone on Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    Relationships

    None yet

      Participants

      @martincostello@kevinchalet@MackinnonBuck

      Issue actions

        Consider making `TokenExtensions.UpdateTokenValue()`'s `tokenValue` parameter nullable · Issue #62257 · dotnet/aspnetcore