Skip to content

How to call an Api with client credential authentication from blazor server-side #26462

Discussion options

You must be logged in to vote

As far as I know, you won't be able to make the call directly from the server, because the server doesn't have access to the private part of the client certificate, nor can it get access to that (the client isn't supposed to disclose that information to the server).

However if you wanted, you could use JS interop to make a call to your own JS code in the browser, and have code there that makes the HTTP request. We don't have a built-in simple mechanism for doing that, since Blazor WebAssembly's implementation is baked into the .NET webassembly runtime and hence can't be used on Blazor Server. So you would have to implement this mechanism yourself.

CC @javiercn for any further suggestions.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@florianwachs
Comment options

Answer selected by javiercn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants