There is a website on wordpress. User registration is performed on the site, accounts are stored in the site database. It is necessary to authenticate users from an external application (Blazor WASM) using the system and the site database, after which, in case of successful authorization, the user will be able to work in an external application.
How can this be done using http requests?
This will depend on a few things -
You will need to include the
authorizationheader with all HTTP requests to ensure the user is still authorized to access you app. Luckily, with Blazor WASM there is a very easy way to add this header to all outgoing HTTP requests using a custom implementation ofAuthorizationMessageHandler. Here's an example that I personally use this exact code successfully in my own Blazor WASM app:Here's it being added to a
HttpClientinProgram.cs: