Azure AD B2C authentication with OAuth2 | Community
Skip to main content
Level 2
July 31, 2024

Azure AD B2C authentication with OAuth2

  • July 31, 2024
  • 1 reply
  • 806 views

Hi,

i set up sign in via azure ad b2c in AEM. 

I oriented on this example implementation: https://www.albinsblog.com/2021/12/enable-user-authentication-for-aem-websites-azureadb2c-oauth.html

The implementation is basically working. Now i have to call a 3rd party API and pass the authentication token. Does anyone know how i can access the token of the currently logged in user in order to use it for the http requests which are sent from the AEM backend?

Also to me it is unclear if i can use the refresh token in order to retrieve a new access token as it seems that only the access token is stored.

Another question i have if i can use the claims in the JWT instead of closed user group as a mechanism to restrict user access to certain areas of my website.

 

Any suggestions or documentation regarding these topics would be useful for me.

Thank you.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

NiklasCrAuthor
Level 2
October 2, 2024

I decided now to implement a custom authentication handler based on this example: https://medium.com/@lars.auffarth/building-an-aem-custom-authentication-handler-for-okta-openid-connect-2d9d42c0161
Now i am facing the problem that it works on the local setup but the redirect url which passes the code back to AEM returns 404 when running in the adobe cloud. I whitelisted the oauth redirect path in the dispatcher. Does anyone know how to resolve this?