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

Add Azure AD support to Explorer #641

Merged
merged 1 commit into from
May 3, 2024
Merged

Add Azure AD support to Explorer #641

merged 1 commit into from
May 3, 2024

Conversation

eputtone
Copy link
Member

@eputtone eputtone commented May 3, 2024

Add Azure AD support to the new Explorer.

If msalConfig is defined in config.js, force the user through Azure AD redirect-based login into the defined application when opening the Explorer. In the example configuration, credentials are cached in localStorage so they are available in different browser tabs as it's relatively normal to open multiple workflows to different tabs.

Because API calls are in a centralized service.ts, we cannot easily use msal-react hooks to access the authentication. Hence, the msalClient created in when opening Explorer is somewhat dirtily piggy-backed in config-object to service.ts and used to acquire and enrich the API calls with Bearer-token.

I haven't tested what happens if all the tokens (including refresh token) are expired. Probably an unclean failure, from which the user can recover by refreshing the browser and starting over. I don't have an environment where API is protected by Azure AD, so I just checked that the Authorization token is generated and set correctly.

So it's somewhat experimental support, but better than nothing and can be improved based on feedback.

@RealZimboGuy
Copy link
Contributor

not sure if you would be interested, we have some code using spring security that can intercept and force a login to ldap ?

@efonsell efonsell merged commit 4a51d59 into master May 3, 2024
38 checks passed
@efonsell efonsell deleted the explorer-msal-azure branch May 3, 2024 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants