How to fix 'isn't in our system. Make sure you typed it correctly.'

Dmitry 0 Reputation points
2025-02-28T07:20:15.7666667+00:00

I am trying to develop feature that will allows users to sign in with Microsoft. I read many articles and docs but almost all of them describe how to do that only for tenant-specific accounts. I don't want to add user accounts manually to my tenant app.

Here is my config:

spring:
  security:
    oauth2:
      client:
        registration:
          microsoft:
            authorization-grant-type: authorization_code
            redirect-uri: http://localhost:8084/api/auth/azure/login/oauth2/code/microsoft
            provider: microsoft
            client-id: ****
            client-secret: ****
            scope:
                - openid
                - email
                - profile
        provider:
          microsoft:
            authorization-uri: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
            token-uri: https://login.microsoftonline.com/common/oauth2/v2.0/token
            user-info-uri: https://graph.microsoft.com/oidc/userinfo
            user-name-attribute: sub
            jwk-set-uri: https://login.microsoftonline.com/common/discovery/v2.0/keys

As i understand authorization-uri must contain 'common' part (not tenant-id). Also Azure Entra Id is configured to allow any types of account to sign in.

enter image description here

But i still can't login with external accounts.

enter image description here

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,426 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.