# Setting up openID authentication code flow with Entra OAuth (AzureAD)

**URL:** <https://community.weweb.io/t/setting-up-openid-authentication-code-flow-with-entra-oauth-azuread/7764>\
**Category:** How do I?\
**Tags:** authentication\
**Created:** [March 26, 2024, 3:52pm UTC](https://community.weweb.io/t/setting-up-openid-authentication-code-flow-with-entra-oauth-azuread/7764 "2024-03-26T15:52:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chimera](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@Chimera](https://community.weweb.io/u/Chimera)\
**Post date:** [March 26, 2024, 3:52pm UTC](https://community.weweb.io/t/setting-up-openid-authentication-code-flow-with-entra-oauth-azuread/7764/1 "2024-03-26T15:52:49Z")

</div>

I am trying to setup Entra ID authentication through the OpenID plugin. Flow is Authorization Code Flow with PKCE. I have setup plugin configuration correctly (see the image below). After the whole OAuth flow I am redirected to Redirect Log In page.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/1/13a4982d48e1052d91e0ccc073eda160bd338ad3.png)

I am redirected to the Redirect Log In page with a “code” query parameter. When I check the Plugin data my user object is filled with null properties and isAuthenticated is true.

Is this a bug, or do I need to call Microsoft api to get id\_token, set this id\_token inside the user object and then call the Fetch User Action/change some config in the Azure?

---

<div class="post-metadata">

**Author:** ![Chimera](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@Chimera](https://community.weweb.io/u/Chimera)\
**Post date:** [March 26, 2024, 3:53pm UTC](https://community.weweb.io/t/setting-up-openid-authentication-code-flow-with-entra-oauth-azuread/7764/2 "2024-03-26T15:53:25Z")

</div>

This is the authentication data

![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/2/263b0526a5973a8ff4d9f4bdd81b66fb18fb2aa2.png)

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [March 28, 2024, 12:39pm UTC](https://community.weweb.io/t/setting-up-openid-authentication-code-flow-with-entra-oauth-azuread/7764/3 "2024-03-28T12:39:47Z")

</div>

Hi @Chimera 👋

> [@Chimera](#):
>
> When I check the Plugin data my user object is filled with null properties and isAuthenticated is true.
> 
> Is this a bug, or do I need to call Microsoft api to get id\_token, set this id\_token inside the user object and then call the Fetch User Action/change some config in the Azure?

Can you show us the login workflow as well? The fact that `isAuthenticated` is `true` but you have no user info makes me think there might be a `Fetch user` action missing but I’m not 100% sure.

---

<div class="post-metadata">

**Author:** ![Chimera](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@Chimera](https://community.weweb.io/u/Chimera)\
**Post date:** [March 28, 2024, 2:20pm UTC](https://community.weweb.io/t/setting-up-openid-authentication-code-flow-with-entra-oauth-azuread/7764/4 "2024-03-28T14:20:32Z")

</div>

Hello!

certainly. On page load of Redirect Log In page I try to fetch user, but it again just returns empty user (as you can see I have the code query parameter in the url as well)

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/866432f691a73668abfe4bb6f98ae051a3f644ef.png)

---

<div class="post-metadata">

**Author:** ![jsjoshua](https://avatars.discourse-cdn.com/v4/letter/j/3e96dc/32.png) [@jsjoshua](https://community.weweb.io/u/jsjoshua)\
**Post date:** [September 20, 2025, 11:10pm UTC](https://community.weweb.io/t/setting-up-openid-authentication-code-flow-with-entra-oauth-azuread/7764/5 "2025-09-20T23:10:05Z")

</div>

Anyone ever solve this? I’m having this problem as well using pocket-id.
