🎓 All Courses | 📚 Blazor WASM Syllabus
Stickipedia University
📋 Study this course on TaskLoco

For enterprise and SaaS apps, integrating OpenID Connect (OIDC) with Blazor WASM gives you standards-based authentication with providers like Microsoft Entra ID, Google, Okta, and Auth0.

Setup

// Program.cs:
builder.Services.AddOidcAuthentication(options =>
{
    builder.Configuration.Bind("Auth0", options.ProviderOptions);
    options.ProviderOptions.ResponseType = "code";
});

appsettings.json

{
  "Auth0": {
    "Authority": "https://your-tenant.auth0.com",
    "ClientId": "your-client-id"
  }
}

Login and Logout Buttons

<AuthorizeView>
    <Authorized>
        <button @onclick="LogOut">Log Out</button>
    </Authorized>
    <NotAuthorized>
        <button @onclick="LogIn">Log In</button>
    </NotAuthorized>
</AuthorizeView>

@code {
    private void LogIn() =>
        Nav.NavigateTo("authentication/login");
    private async Task LogOut() =>
        Nav.NavigateTo("authentication/logout");
}

YouTube • Top 10
Blazor WASM: OpenID Connect and OAuth2
Tap to Watch ›
📸
Google Images • Top 10
Blazor WASM: OpenID Connect and OAuth2
Tap to View ›

Reference:

Wikipedia: OpenID Connect

image for linkhttps://en.wikipedia.org/wiki/OpenID_Connect

📚 Blazor WASM — Full Course Syllabus
📋 Study this course on TaskLoco

TaskLoco™ — The Sticky Note GOAT