Skip to content

Comments

Blazor Web (InteractiveAuto) with BFF + YARP and token exchange api call sample#384

Open
m3nax wants to merge 34 commits intoopeniddict:devfrom
m3nax:blazor-web-auto-exchange-sample
Open

Blazor Web (InteractiveAuto) with BFF + YARP and token exchange api call sample#384
m3nax wants to merge 34 commits intoopeniddict:devfrom
m3nax:blazor-web-auto-exchange-sample

Conversation

@m3nax
Copy link
Contributor

@m3nax m3nax commented Feb 10, 2026

Esempio blazor che fa uso di BFF with YARP e token exchange.

Pages:

  • Home page with a brief explanation of the purpose of the example
  • Unauthenticated page counter
  • Authenticated weather page that uses token exchange
  • AdminOnly page that shows how to propagate user roles to the webassembly client when InteractiveMode is enabled

Related to #367

Copy link
Member

@kevinchalet kevinchalet left a comment

Choose a reason for hiding this comment

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

Thanks for this great PR! 👏🏻

var sanitizedUrl = returnUrl switch
{
null or "" => baseRoute,
_ when !Uri.IsWellFormedUriString(returnUrl, UriKind.Relative) =>
Copy link
Member

Choose a reason for hiding this comment

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

FYI: we now avoid Uri.IsWellFormedUriString() like the plague as it returns false negatives for correctly encoded URIs.

Since we're in a minimal API context, let's just use RedirectHttpResult.IsLocalUrl() instead (it internally uses a much safer logic).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to know

@m3nax m3nax requested a review from kevinchalet February 11, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants