Expand my Community achievements bar.

Azure AD B2C authentication with OAuth2

Avatar

Level 2

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.

1 Reply

Avatar

Level 2

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-conn...
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?