# Retrieve auth0 access token through Azure Bot Channel Registration with Generation Oath 2 connection

**URL:** <https://community.auth0.com/t/retrieve-auth0-access-token-through-azure-bot-channel-registration-with-generation-oath-2-connection/63050>\
**Category:** Get Help\
**Tags:** azure, access-token\
**Created:** [May 19, 2021, 12:15pm UTC](https://community.auth0.com/t/retrieve-auth0-access-token-through-azure-bot-channel-registration-with-generation-oath-2-connection/63050 "2021-05-19T12:15:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nkr](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nkr/32/13700_2.png) [@nkr](https://community.auth0.com/u/nkr)\
**Post date:** [May 19, 2021, 12:15pm UTC](https://community.auth0.com/t/retrieve-auth0-access-token-through-azure-bot-channel-registration-with-generation-oath-2-connection/63050/1 "2021-05-19T12:15:34Z")

</div>

Hey all,

I am having some issues retrieving correct access token through Generic Oauth 2 connection from my Azure Bot Framework.

My connection settings are as follows:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/4/1/4123856cc3c7c9b5adcf22fde84c5289f5e83346.png)

When I test connection ,it prompts me to log in using auth0 as expected - in Auth0 logs I can see that the login succeeds, and I can see I get redirected to my expected redirect url.

The resulting access token I get in the result page is as follows:  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/a/9/a909f530e0bbe6d58c782b5c4405830627dc758b.png)

Which seemed wrong, I used jwt token decode to confirm, and it is indeed an invalid access token.

If I try the connection with my Azure AD, I retrieve a correct usable access token (but for my O365 account), and it needs to work with Auth0 users.

---

<div class="post-metadata">

**Author:** ![nkr](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nkr/32/13700_2.png) [@nkr](https://community.auth0.com/u/nkr)\
**Post date:** [May 20, 2021, 7:17am UTC](https://community.auth0.com/t/retrieve-auth0-access-token-through-azure-bot-channel-registration-with-generation-oath-2-connection/63050/2 "2021-05-20T07:17:46Z")

</div>

Swapped to OAuth 2 Generic Provider and manually set up the URL templates to supply the requests with missing audience parameter, and it works as expected now.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 20, 2021, 9:14am UTC](https://community.auth0.com/t/retrieve-auth0-access-token-through-azure-bot-channel-registration-with-generation-oath-2-connection/63050/3 "2021-05-20T09:14:03Z")

</div>

Perfect! Thanks for sharing it with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 27, 2021, 11:49am UTC](https://community.auth0.com/t/retrieve-auth0-access-token-through-azure-bot-channel-registration-with-generation-oath-2-connection/63050/4 "2021-05-27T11:49:17Z")

</div>


