# OIDC enterprise connection to Azure AD using authorisation code flow with pkce

**URL:** <https://community.auth0.com/t/oidc-enterprise-connection-to-azure-ad-using-authorisation-code-flow-with-pkce/100330>\
**Category:** Get Help\
**Tags:** oidc-enterprise-connection, connections\
**Created:** [February 13, 2023, 5:04am UTC](https://community.auth0.com/t/oidc-enterprise-connection-to-azure-ad-using-authorisation-code-flow-with-pkce/100330 "2023-02-13T05:04:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![duane.vantwest](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/duane.vantwest/32/42718_2.png) [@duane.vantwest](https://community.auth0.com/u/duane.vantwest)\
**Post date:** [February 13, 2023, 5:04am UTC](https://community.auth0.com/t/oidc-enterprise-connection-to-azure-ad-using-authorisation-code-flow-with-pkce/100330/1 "2023-02-13T05:04:50Z")

</div>

I can see how a custom connection to Azure AD can be achieved using the implicit flow.  
Is there a way of enabling PKCE? I’ve seen a random blog where it says you can use the management api to update the connection options with “pkce\_enabled”: true  
([Authorization Code with PKCE via connection](https://community.auth0.com/t/authorization-code-with-pkce-via-connection/91339)).  
I didn’t have any luck updating the connection object (bad json formats and encoding issues).

Does anyone know if auth code flow with PKCE is possble from Auth0 connectors to Azure AD?  
Is there a simple way of configuring it?  
Should the Azure AD application be configured as SPA or native / mobile app?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [February 15, 2023, 4:28pm UTC](https://community.auth0.com/t/oidc-enterprise-connection-to-azure-ad-using-authorisation-code-flow-with-pkce/100330/3 "2023-02-15T16:28:20Z")

</div>

Hi @duane.vantwest,

Have you seen our doc on [Connect Your App to Microsoft Azure Active Directory](https://auth0.com/docs/authenticate/identity-providers/enterprise-identity-providers/azure-active-directory/v2)?

---

<div class="post-metadata">

**Author:** ![duane.vantwest](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/duane.vantwest/32/42718_2.png) [@duane.vantwest](https://community.auth0.com/u/duane.vantwest)\
**Post date:** [February 15, 2023, 10:48pm UTC](https://community.auth0.com/t/oidc-enterprise-connection-to-azure-ad-using-authorisation-code-flow-with-pkce/100330/4 "2023-02-15T22:48:35Z")

</div>

Hi Dan,  
Yes I have seen that documentation. I’ve setup and used an Azure AD connection successfully in the past. That isn’t the problem.  
I want to authorise to an Idp (azure ad in this case) WITHOUT a client secret. In order to do this we need to use either implicit flow or, preferably, authorisation code flow with PKCE (pkce is more secure and recommended over implicit flow).

My question is, can authorisation code flow with PKCE be enabled / configured between Auth0 Connection and Azure AD? I suspect you need to do this via an Enterprise Custom OIDC connection.

thank you  
Duane

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [February 16, 2023, 1:23pm UTC](https://community.auth0.com/t/oidc-enterprise-connection-to-azure-ad-using-authorisation-code-flow-with-pkce/100330/5 "2023-02-16T13:23:59Z")

</div>

Hi @duane.vantwest,

Thanks for the added detail, that info is clarifying. To confirm; you want to use PKCE between Auth0 and your IdP (Azure AD, in this case).

AFAIK, this is currently possible, but let me reach out to the team to confirm.

In the meantime, can you expand on the use case? Is this request a result of OAuth2.1?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [February 16, 2023, 3:24pm UTC](https://community.auth0.com/t/oidc-enterprise-connection-to-azure-ad-using-authorisation-code-flow-with-pkce/100330/6 "2023-02-16T15:24:42Z")

</div>

Update: The team is actively working on this feature.

---

<div class="post-metadata">

**Author:** ![duane.vantwest](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/duane.vantwest/32/42718_2.png) [@duane.vantwest](https://community.auth0.com/u/duane.vantwest)\
**Post date:** [February 17, 2023, 1:22am UTC](https://community.auth0.com/t/oidc-enterprise-connection-to-azure-ad-using-authorisation-code-flow-with-pkce/100330/7 "2023-02-17T01:22:57Z")

</div>

Thanks Dan. That’s great feedback. Look forward to this feature. We can get by in the short term by either a) using implicit flow or b) using the Azure AD connections and use the AD app client and secret id.  
Cheers  
Duane

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [February 21, 2023, 2:50pm UTC](https://community.auth0.com/t/oidc-enterprise-connection-to-azure-ad-using-authorisation-code-flow-with-pkce/100330/8 "2023-02-21T14:50:01Z")

</div>

Thanks for the follow up!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 7, 2023, 2:50pm UTC](https://community.auth0.com/t/oidc-enterprise-connection-to-azure-ad-using-authorisation-code-flow-with-pkce/100330/9 "2023-03-07T14:50:52Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
