Skip to content

Passing tokens in interactive BWAs #35286

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

Merged
merged 15 commits into from
Apr 29, 2025
Merged

Passing tokens in interactive BWAs #35286

merged 15 commits into from
Apr 29, 2025

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented Apr 22, 2025

Addresses #31691
Addresses #35225

The obvious approach to take for the base use case of getting tokens for web API calls is via use of a token handler (DelegatingHandler) attached to the HttpClient with AddHttpMessageHandler in the server project. This will work regardless of render mode and in concert with the CookieOidcRefresher of OIDC sample apps and in concert with MS Identity Web API/packages (including the Downstream API package).

This PR also brings the security node articles for our sample apps up to speed with the changes that I made over on the samples repo ...

  • Those apps now have web API in external projects.
  • We're pushing devs to create separate registrations for apps and web APIs.

Internal previews

📄 File 🔗 Preview link
aspnetcore/blazor/call-web-api.md aspnetcore/blazor/call-web-api
aspnetcore/blazor/components/httpcontext.md aspnetcore/blazor/components/httpcontext
aspnetcore/blazor/fundamentals/index.md aspnetcore/blazor/fundamentals/index
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

@guardrex guardrex self-assigned this Apr 22, 2025
@MarvinKlein1508

This comment was marked as resolved.

@guardrex

This comment was marked as resolved.

@guardrex

This comment was marked as resolved.

@guardrex

This comment was marked as resolved.

@MarvinKlein1508

This comment was marked as resolved.

@guardrex

This comment was marked as resolved.

@guardrex guardrex removed the request for review from halter73 April 29, 2025 00:21
@guardrex guardrex merged commit 776622e into main Apr 29, 2025
3 checks passed
@guardrex guardrex deleted the guardrex/blazor-added-webapi branch April 29, 2025 13:39
mccoylstevens pushed a commit to POWER-OF-ATTORNEY/AspNetCore.Docs that referenced this pull request May 13, 2025
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.

2 participants