-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redis token cache for msal-node? #2828
Comments
This issue has not seen activity in 14 days. It will be closed in 7 days if it remains stale. |
Unfortunately we do not have a |
@eanders-ms There was actually discussion on this a while ago in an msal-python issue: AzureAD/microsoft-authentication-library-for-python#98 @sameerag I am looking for something similar in a python context, but the use case generalizes to platforms like node as well. In my case it concerns a backend web-application running on kubernetes with multiple replicated pods, where MSAL is used to gather an authentication token to connect to another Microsoft API. Having a distributed cache like Redis would save us a few API calls. |
I followed up on this and there is a library wide effort we want to make to standardize persistence for web apps (distributed cache). We are not yet clear on the timelines though. We will reach out once this feature gets the green, please watch out our roadmap for the announcement. |
I would like to request this feature as well! I would like to use |
I am looking for the solution/recommendation on the below remarks. Highly appreciated if anyone can point to any reference implementation. |
@manandkumaar As far as I know there is no reference implementation available of implementing a redis-based cache. You only have two different implementations by Microsoft:
So if you want to have redis cache, you have roughly 2 options for now:
|
Hey @eanders-ms @benvdh @richban @manandkumaar, check out the ExpressTestApp sample, which has an example distributed cache implementation now. msal-node will eventually provide APIs to make working with this easier, but hopefully this helps in the meantime. Make sure to take a look at caching docs as well. |
@derisen Thank you for this! It's extremely helpful! |
Implemented as close as I could but I feel like I am getting a delay. Is this expected? When running below I don't get any errors and I can see my cachePlugin "working". Heres where I feel it's not working. Each time File: msAuthLibrary const config = { let authProvider = new msal.ConfidentialClientApplication(config); async function initializeTokenCachePlugin(req, res, next) { file: server.js const session = require("./logic/middleware/sessions"); var app = express(); // CORS Cofig // Session Middleware app.locals.msalClient = msAuthLibrary.authProvider; app.use(logger("dev")); app.use(msAuthLibrary.initializeTokenCachePlugin); app.use("/", indexRouter); // catch 404 and forward to error handler module.exports = app; |
Apply the syntax highlight properly for better readability. I might be able to help you. |
Library
@azure/[email protected]
Description
Does a redis-backed token cache exist for msal-node (for use in confidential client application)? If not, could you point me to an existing implementation in another framework/language that would serve as a good reference? I would try to port it to js. I'm looking at the dotnet library's equivalent as a potential candidate.
Source
The text was updated successfully, but these errors were encountered: