Skip to content

Add the latest recommended passing tokens approach #35482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented May 16, 2025

@guardrex guardrex self-assigned this May 16, 2025
@guardrex guardrex force-pushed the guardrex/blazor-passing-tokens branch from e1f1442 to d653a02 Compare May 16, 2025 18:39
@guardrex guardrex requested a review from halter73 May 19, 2025 18:01
@guardrex guardrex marked this pull request as ready for review May 19, 2025 18:22
var claimsIdentity = new ClaimsIdentity(context.Principal?.Identity,
[new Claim("AccessToken", accessToken ?? "No Access Token!")]);
context.Principal = new ClaimsPrincipal(claimsIdentity);
context.Properties.Items.Remove("access_token");

This comment was marked as resolved.

This comment was marked as resolved.

if (user is not null)
{
var accessToken =
user.Claims.First(c => c.Type == "AccessToken")?.Value;

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

@guardrex guardrex marked this pull request as draft May 29, 2025 23:53
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.

Update section on passing tokens in Blazor Web Apps
2 participants