Auth0 Setup for Bloqs

This guide covers all steps required to configure Auth0 for Bloqs, including application creation, API setup, post-login actions, and updating your .NET configuration.


Create a New Application

  • Log in to your Auth0 Dashboard.

  • Navigate to Applications → Applications and click Create Application.

  • Enter details:

    • Name: Bloqs App

    • Application Type: Single Page Application (SPA)

  • Click Create.

Configure Application Settings

  • Allowed Callback URLs:

    https://localhost:5001/authentication/login-callback
  • Allowed Logout URLs:

    https://localhost:5001
  • Allowed Web Origins:

    https://localhost:5001
  • Enable Cross-Origin Authentication: Toggle ON


Create an API

  • Navigate to Applications → APIs.

  • Click Create API.

  • Enter details:

    • Name: Bloqs API

    • Identifier: https://bloqs.local/api

    • Signing Algorithm: RS256

  • Click Create


Add a Post-Login Action

  • Navigate to Actions → Triggers → Post Login.

  • Click + Add Action → Build Custom.

  • Name it Add Claims and add the following code:

  • Click Deploy and ensure the action is connected to the Post-Login Flow.


Update .NET AppSettings

Update your .NET project appsettings.json to match your Auth0 configuration:

  • Domain: From your Auth0 application settings.

  • ClientId: From your Auth0 SPA application.

  • Audience: Must match the API Identifier (https://bloqs.local/api).


Verify Setup

  • Run Bloqs locally: https://localhost:5001.

  • Log in using Auth0 credentials.

  • Check the access token to ensure the custom claims (email, nickname, name) are included.

Last updated