I tried to integrate Sitecore 9 with Azure AD. It was successful. I have used persistent user setting therefore user is automatically created.

Unfortunately, in old system some users already existed.

I want to follow business requirements:

  • If Azure AD account has same email with a old account => it will be mapped and no need to create new user

How can I achieve this with federated authentication?

  • hey Cuong, can you post your code? I believe you'd need to achieve this in the middleware. I belive the issue might be related to the default ExternalUserBuilder as it creates a random username so it might not be detecting the user (if you are using the sample configuration that comes with sitecore 9)
    – josedbaez
    Apr 10, 2018 at 10:40

1 Answer 1


You can do this by overriding CreateUniqueUserName in default ExternalUserBuilder and also implementing your own ApplicationUserResolver.



  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Oct 6, 2021 at 6:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.