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

Is vuex-oidc compatible with MS Azure ID? #205

Open
matteogll opened this issue Mar 21, 2023 · 2 comments
Open

Is vuex-oidc compatible with MS Azure ID? #205

matteogll opened this issue Mar 21, 2023 · 2 comments

Comments

@matteogll
Copy link

This library works fine with my current identity provider (IdentityServer).
Now I have to migrate a Vue 2 app from IdentityServer to Azure ID as identity provider.
I guess this library should do the job (instead of rewriting code to use the official msal library).
Is there an example on how to configure it for an Azure ID scenario?

Thanks

@perarnborg
Copy link
Owner

@matteogll the compatability question is more directed to the core library that this lib uses (oidc-client-ts or oidc-client pre v4).

I have no example to provide, but since Azure AD uses oAuth it should be compatible.

@matteogll
Copy link
Author

matteogll commented Mar 23, 2023

Thanks @perarnborg,
I got a working solution yesterday.
I have to add /v2.0/ at the end of "authority" URL in order to properly pass scopes and get a valid access_token.
I put it below if it can help somebody who is working with Azure as Identity Provider too.
This configuration is for vuex-oidc library version >= 4

const identityAzureSettings = {
    authority: "https://login.microsoftonline.com/{tenant-id}/v2.0/", // I've added /v2.0/ to get a valid JWT access_token
    client_id: "{client-id}", 
    redirectUri: "http://localhost:8080/callback", 
    postLogoutRedirectUri: "http://localhost:8080",
    responseType: "code", 
    scope: "openid profile api://...",
    popupRedirectUri: "http://localhost:8080",
    silentRedirectUri: "http://localhost:8080/silent-refresh",
    automaticSilentRenew: true,
    filterProtocolClaims: true,
    loadUserInfo: false,
    includeIdTokenInSilentRenew: false, // https://github.com/IdentityModel/oidc-client-js/issues/172
};

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

No branches or pull requests

2 participants