Best way to create,store and update TokenCache in AEM | Community
Skip to main content
nvssr90
Level 2
December 28, 2023
Solved

Best way to create,store and update TokenCache in AEM

  • December 28, 2023
  • 2 replies
  • 1156 views

Hey, I am integrating Azure MSAL 4J with AEM as Cloud Service(Publish Instance) for SSO Authentication. To store the session for longer times I have to implement a token cache which creates a serialized_cache.json file and gets the session if this is available. here is the documentation reference I am trying to implement:

 

Custom token cache serialization (MSAL4j) - Microsoft Authentication Library for Java | Microsoft Learn

 

What is the best way to create/store/update this file from AEM? Is there a way we can store this in AEM runtime? any examples - Does AEM as Cloud service provide any features to store this(Environment Variables)?

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

the AEM implementation stores the token below the users home node. Make sure that it's synced amongst the publish instances.

2 replies

joerghoh
Adobe Employee
Adobe Employee
December 29, 2023

Why don't you use SAML to authenticate against the Azure Directory?

nvssr90
nvssr90Author
Level 2
December 29, 2023

we have a follow up use case to get users from different portal. so, OOTB SAML won't work for us. So, I created a custom authentication handler to get the token from there we will log on to diff system to get the permissions for the users

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
December 29, 2023

the AEM implementation stores the token below the users home node. Make sure that it's synced amongst the publish instances.

Level 2
August 6, 2024

Hi nvssr90.

I am also trying to achieve integrating Azure MSAL 4J with AEM as Cloud Service for authentication. Could you please share any good documentation you followed and what authority did you use? Our's is an Azure B2C tenant and facing issues with setting the authority url properly.