Skip to content

Cannot auto create user with Azure SSO provider #1404

@adrienbroyere

Description

@adrienbroyere

Hi,

I have successfully setup the Azure SSO provider using OIDC but I cannot seems to use the auto create user feature. Below is my SSO configuration:

- name: Azure
  auto_create_users: true
  provider:
    type: azure
    client_id: xxx
    client_secret: yyy
    tenant: zzz

I can observe the following error in the log

01.07.2025 15:28:58 ERROR HTTP: warpgate_core::config_providers::db: The OIDC server did not provide a preferred_username claim for this user
01.07.2025 15:28:58 ERROR HTTP: warpgate_protocol_http::api::sso_provider_list: SSO error: No user matching xxx

The Microsoft Entra documentation states that preferred_username can be configured as an optional claims. But even though I have correctly set it in my Microsoft Entra application, I still observe the same error logs.

I can successfully log in if the user was previously created and its sso information correctly configured though. But that defy the purpose of automatically creating users.

In the meantime, I have switched to the custom provider which is able to automatically create the users upon sign on.

- name: Azure
  auto_create_users: true
  provider:
    type: custom
    client_id: xxx
    client_secret: yyy
    issuer_url: azure issuer url
    scopes: ["openid", "email", "profile"]

It works well even when not configuring the preferred_username optional claim in the Microsoft Entra application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions