Skip to content
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

The current environment is Blazor Wasm, and the API tool used is Refit, and the current requirement is to bring the AD information in the Windows domain when logging in to request the API in exchange for a token #55378

Closed
1 task done
W2426566602 opened this issue Apr 26, 2024 · 1 comment
Labels
area-blazor Includes: Blazor, Razor Components question

Comments

@W2426566602
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

But when I set httpclient's UseDefaultCredentials runtime, it will get an error, of course I know the reason, because this is a server-side function, so I want to ask how to do this scenario

Describe the solution you'd like

What should I do

Additional context

What should I do

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Apr 26, 2024
@mkArtakMSFT
Copy link
Member

mkArtakMSFT commented Apr 29, 2024

@W2426566602 you may get some help from our Windows auth docs here: https://learn.microsoft.com/aspnet/core/security/authentication/windowsauth?view=aspnetcore-8.0&tabs=visual-studio
As for the UseDefaultCredential flag, it's not supported on the WebAssembly runtime, and hence the exception. We recommend using OIDC instead, where possible.
It looks like this is something many developers have already faced and solved and there are threads on StackOverflow on this topic: https://stackoverflow.com/a/70691831/719967

@mkArtakMSFT mkArtakMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components question
Projects
None yet
Development

No branches or pull requests

2 participants