# Custom Tenant ID in Microsoft Identity Provider

**URL:** <https://forum.keycloak.org/t/custom-tenant-id-in-microsoft-identity-provider/8858>\
**Category:** Configuring the server\
**Created:** [May 3, 2021, 1:28pm UTC](https://forum.keycloak.org/t/custom-tenant-id-in-microsoft-identity-provider/8858 "2021-05-03T13:28:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mardomz](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/mardomz/32/3036_2.png) [@Mardomz](https://forum.keycloak.org/u/Mardomz)\
**Post date:** [May 3, 2021, 1:28pm UTC](https://forum.keycloak.org/t/custom-tenant-id-in-microsoft-identity-provider/8858/1 "2021-05-03T13:28:06Z")

</div>

Hi all, I have a problem with server configuration, which I can’t solve (for now I can solve it by defining a generic OpenID connect, but this solution has other problems).

Is it possible to use a custom Tenant ID in Microsoft identity provider connector?

In other words is possible to change AUTH\_URL and TOKEN\_URL (according to the source code: [keycloak/MicrosoftIdentityProvider.java at master · keycloak/keycloak · GitHub](https://github.com/keycloak/keycloak/blob/master/services/src/main/java/org/keycloak/social/microsoft/MicrosoftIdentityProvider.java)) to replace ‘common’ endpoint with my Tenant ID endpoint, i.e. instead of:

“/common/oauth2/v2.0/authorize”

I need

“/_MY\_TENANT\_ID_/oauth2/v2.0/authorize”

This change is necessary for my application to run as a Single Tenant. The ‘common’ endpoint only supports Multi Tenant applications.

Thanks for help.

---

<div class="post-metadata">

**Author:** ![vitalyrychkov](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/vitalyrychkov/32/3908_2.png) [@vitalyrychkov](https://forum.keycloak.org/u/vitalyrychkov)\
**Post date:** [September 15, 2021, 10:38am UTC](https://forum.keycloak.org/t/custom-tenant-id-in-microsoft-identity-provider/8858/2 "2021-09-15T10:38:32Z")

</div>

Same question here, i cannot find a way to select a tenant when using the microsoft identity provider.

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [September 15, 2021, 3:49pm UTC](https://forum.keycloak.org/t/custom-tenant-id-in-microsoft-identity-provider/8858/3 "2021-09-15T15:49:13Z")

</div>

It would be possible to implement your own custom Identity Provider extension that allows you to override the endpoint with the tenant ID. This could either be done dynamically (i.e. add to the realm-identity-provider-microsoft.html template and store the tenant ID value in the identity provider config), or you could just do a one-off for your specific tenant ID.

---

<div class="post-metadata">

**Author:** ![marianobntz-silohub](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/marianobntz-silohub/32/4270_2.png) [@marianobntz-silohub](https://forum.keycloak.org/u/marianobntz-silohub)\
**Post date:** [October 30, 2021, 8:53pm UTC](https://forum.keycloak.org/t/custom-tenant-id-in-microsoft-identity-provider/8858/4 "2021-10-30T20:53:15Z")

</div>

No news about this issue?? it is a show stopper for this integration to work with a regular Azure AD Tenant config.  
Thanks
