Skip to content
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

Persist token cache in encrypted format to file in linux container image #4862

Open
shoaibbajwa24 opened this issue Jul 25, 2024 · 2 comments

Comments

@shoaibbajwa24
Copy link

We have a scenario where I have a c# code which runs in a container. It uses MSAL AcquireTokenWithDeviceCode to get user access token to pass on to a backend api. The container runs does a task and exits. The user could run the container multiple times. The issue is that since its in a container, MSAL token cache is lost during different runs and its a pain to keep asking users to login everytime. The container image exists for both linux and windows.

I know we can persist the cache in to a file which i have tested but we want to keep it encrypted. From my understanding MSAL uses libsecret in linux for encryption. Our container base image we are using does not have libsecret and its pain to get it to work for headless environment.

Also saw this #3033

What is MSAL recommendation on this?

@rayluo
Copy link
Contributor

rayluo commented Aug 1, 2024

From my understanding MSAL uses libsecret in linux for encryption. Our container base image we are using does not have libsecret and its pain to get it to work for headless environment.

What is MSAL recommendation on this?

For what it's worth, at one point we build a docker image with libsecret (among others), but we mainly use it for testing purpose.

@bgavrilMS
Copy link
Member

@shoaibbajwa24 - Device Code Flow is problematic because it doesn't really go through the browser on the same machine. So we cannot enforce security requirements with it. It is slowing being deprecated.

Identity doesn't have a good answer to this scenario - auth in headless scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants