Get Started with Blazor and Web Assembly

Get Started with Blazor and Web Assembly

This tutorial walks you through the basics of Blazor and WebAssembly.

blink

Pretty exciting stuff - thanks for the post

John Underhill

Um, how about an example of how to authenticate with Okta? Isn’t this an Okta site? Aren’t there some unique or at least subtle considerations here?

HassanGulzar

My thought exactly…

Curtis Jackson

Mines too. Even more so that the Blazor Web Assembly app (SPA) version is now production ready

Curtis Jackson

Well after many hours of reading and trial and errors I have successfully configured, connected and authenticated a user using a Blazor Web Assembly project and not a Blazor Server project as used in Ibrahim Šuta’s example; here is what I did:

1. In Visual Studio, create a Blazor WebAssembly app. Set Authentication to Individual User Accounts with the Store user accounts in-app option.

2. Go into your Okta dasboard and creata a new application integration choosing Single Page App (SPA) as the platform and click create.

3. Next add the following to the Login and Logout urls, https://localhost:5001/authentication/login-callback/ and https://localhost:5001/authentication/logout-callback/, respectively. Please note that your base-url values my differe based on your launchsettings.json file within your project’s Properties folder.

4. In Visual Studio you can either hard-code your Okta domain value to the ProviderOptions.Authority property in the Program.cs file or set this same value to the Authority property for the Local object in the appsettings.json file inside of the project’s wwwroot folder.

5. In Visual Studio you can either hard-code the Client ID value to the ProviderOptions.ClientId property in the Program.cs file or set this same value to the ClientId property for the Local object in the appsettings.json file inside of the project’s wwwroot folder.

That’s it!!

That is all that is needed and you are now ready to go!

Run the application and click the login link and you will be redirected to Okta to sign in.

Below are some useful links that I had used to help me make sense of things; it might do the same for you:
https://docs.microsoft.com/…

https://docs.microsoft.com/…

https://docs.microsoft.com/…

Feng Yun

Hi, question: is there any way to configure internet proxy for OKTA Blazor?

Thanks in advance!

Feng Yun

Ignore. Found it. There is Proxy property at OktaMvcOptions.