Skip to content

Opaque (reference) access token guidance#36588

Merged
guardrex merged 25 commits into
mainfrom
guardrex/blazor-oidc-opaque-access-tokens
May 28, 2026
Merged

Opaque (reference) access token guidance#36588
guardrex merged 25 commits into
mainfrom
guardrex/blazor-oidc-opaque-access-tokens

Conversation

@guardrex
Copy link
Copy Markdown
Collaborator

@guardrex guardrex commented Jan 7, 2026

Fixes #36422

cc: @mikekistler

Stephen ... I hacked some nasty 🦖 code 🙈😆 with the help of AI to give you an idea of what I have in mind for the bits that call the auth server to validate the token.

Apparently, Entra doesn't support opaque access token validation, per this MS answer as of 2023 and a local test that I just ran here with Entra.

I originally had this in the BWA-OIDC article, but it's more general than that, so I just moved it to the additional scenarios article and cross-linked to it there from a few spots.


Internal previews

📄 File 🔗 Preview link
aspnetcore/blazor/security/additional-scenarios.md aspnetcore/blazor/security/additional-scenarios
aspnetcore/blazor/security/blazor-web-app-with-entra.md aspnetcore/blazor/security/blazor-web-app-with-entra
aspnetcore/blazor/security/blazor-web-app-with-oidc.md aspnetcore/blazor/security/blazor-web-app-with-oidc
aspnetcore/blazor/security/index.md aspnetcore/blazor/security/index

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive guidance for handling opaque (reference) access tokens in ASP.NET Core Blazor Web Apps with OIDC authentication, addressing issue #36422. The documentation explains when opaque tokens are supported by default and provides a starting-point implementation for scenarios requiring custom token validation.

Key Changes

  • Explains that AddOpenIdConnect inherently supports opaque tokens for basic authentication scenarios without additional configuration
  • Documents the limitation when opaque tokens need to be validated by services using AddJwtBearer
  • Provides a custom AuthenticationHandler implementation as a starting point for developers who need to validate opaque tokens via introspection endpoints

Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
@guardrex guardrex requested a review from halter73 January 7, 2026 14:33
@guardrex

This comment was marked as outdated.

@guardrex

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 6 comments.

Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
guardrex and others added 13 commits May 19, 2026 09:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Luke Latham <1622880+guardrex@users.noreply.github.com>
@guardrex guardrex force-pushed the guardrex/blazor-oidc-opaque-access-tokens branch from b071c5a to 8b16fd9 Compare May 19, 2026 13:14
Comment thread aspnetcore/blazor/security/additional-scenarios.md Outdated
Comment thread aspnetcore/blazor/security/additional-scenarios.md Outdated
Comment thread aspnetcore/blazor/security/additional-scenarios.md Outdated
Comment thread aspnetcore/blazor/security/additional-scenarios.md
Comment thread aspnetcore/blazor/security/additional-scenarios.md Outdated
Comment thread aspnetcore/blazor/security/additional-scenarios.md Outdated
Comment thread aspnetcore/blazor/security/additional-scenarios.md
@damienbod
Copy link
Copy Markdown
Contributor

Hi @guardrex nice work. If you are making docs about introspection, I think you should mention something about the revocation endpoint and that when using reference tokens, these are typically invalidated on a logout event using the revocation endpoint.

@guardrex

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread aspnetcore/blazor/security/additional-scenarios.md
Comment thread aspnetcore/blazor/security/additional-scenarios.md Outdated
Comment thread aspnetcore/blazor/security/additional-scenarios.md Outdated
@guardrex
Copy link
Copy Markdown
Collaborator Author

@halter73 ... There was considerable churn (nine commits) while updating this. It's best if you look at the latest version of the PR to determine if the updates are sane. Unfortunately, I can't squash the nine commits into one because the Copilot commit was a merge commit.

@guardrex
Copy link
Copy Markdown
Collaborator Author

@damienbod ... Would you review the updates? Stephen might be unavailable right now, and this PR is very close to being ready to merge. If you'll review the last couple of updates that I made per your suggestions, I'll ask Wade to look things over after that, and these updates can be published.

Comment thread aspnetcore/blazor/security/additional-scenarios.md Outdated
Comment thread aspnetcore/blazor/security/additional-scenarios.md Outdated
Comment thread aspnetcore/blazor/security/additional-scenarios.md
@damienbod
Copy link
Copy Markdown
Contributor

LGTM, just adds 2 comments

Comment thread aspnetcore/blazor/security/additional-scenarios.md
@guardrex
Copy link
Copy Markdown
Collaborator Author

Thanks @damienbod! ... The NOTE is obviously going to be for advanced devs. I have nothing in our doc set that I can cross-link for that approach.

Co-authored-by: Luke Latham <1622880+guardrex@users.noreply.github.com>
@guardrex guardrex requested a review from wadepickett May 28, 2026 13:27
@guardrex
Copy link
Copy Markdown
Collaborator Author

@wadepickett ... @halter73 has gone MIA again! 😆 He's probably buried in code somewhere! I made all of his suggested updates, and @damienbod reviewed (thx again, Damien! 🙏). I think we're in good shape thus far. If we get your suggestions addressed, we can merge this. No rush tho ... it doesn't have to be today ... or even this week for that matter.

Copy link
Copy Markdown
Member

@halter73 halter73 left a comment

Choose a reason for hiding this comment

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

Only stage, and if you think it's good to go, feel free to leave no comments and tell me

Comment thread aspnetcore/blazor/security/additional-scenarios.md
Comment thread aspnetcore/blazor/security/additional-scenarios.md
Comment thread aspnetcore/blazor/security/additional-scenarios.md
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/additional-scenarios.md
Comment thread aspnetcore/blazor/security/additional-scenarios.md
Comment thread aspnetcore/blazor/security/additional-scenarios.md
Comment thread aspnetcore/blazor/security/additional-scenarios.md
Comment thread aspnetcore/blazor/security/blazor-web-app-with-entra.md Outdated
Comment thread aspnetcore/blazor/security/blazor-web-app-with-oidc.md Outdated
Comment thread aspnetcore/blazor/security/additional-scenarios.md
Comment thread aspnetcore/blazor/security/additional-scenarios.md
@halter73
Copy link
Copy Markdown
Member

I think this all looks good to merge. Sorry for all the repeated/stale review content! I should have noticed that before posting.

@guardrex guardrex merged commit 9ab2a1f into main May 28, 2026
4 checks passed
@guardrex guardrex deleted the guardrex/blazor-oidc-opaque-access-tokens branch May 28, 2026 20:16
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.

OIDC Solution Doesn't Work With Opaque Access Tokens

5 participants