2

In my blazor web assembly project, I have to connect to a Web API that doesn't implement OIDC.

I read on the aspnetcore github thet they made the choice to implement only OIDC connections...

I think I have to write a custom implementation of RemoteAuthenticationService and add it via the builder.Services.AddRemoteAuthentication method, but can't understand how to do this. Reading the current implementation of RemoteAuthenticationService doesn't help.

The only thing I have to do to connect the Web API is to call this URI :

https://<webapi>/oauth/Authorize?client_id=<MyClientId>&state=<State>&scope=read&response_type=token&redirect_uri=<RedirectUri>

The user fill in the form and get redirected in my blazor app via the RedirectUri, having the accessToken in url parameters.

Then I have to add the accessToken in the headers of all Web API Requests, but I found how to do it via AuthorizationMessageHandler.

How can I implement this flow with Blazor Web Assembly ? Do I search in wrong direction ?

4

0 回答 0