Using MSAL with non-Microsoft Identity providers

Viewed 328

I would like to know if MSAL can be used with Identity providers other than Microsoft products. If yes, how. I checked the MSAL documentetion but it is not straightforward in this question. What I would like to do is to authenticate to Google and OneLogin (and possibly others later) using MSAL, but I don't know how. However, I successfully used MSAL with Azure AD.

MSAL seems to be a good library to use it generally with any IDPs.

1 Answers

PROVISO

I believe you're asking about MSAL.JS, as using MSAL.NET with a non-MS OpenID Connect provider is unnecessary, as Microsoft.AspNetCore.Identity provides sufficient support for social logins and vendors of custom OpenID Connect servers provide own extensions (see IdentityServer docs and OpenIdDict samples)

ANSWER

Yes, it's possible to use a non-MS OIDC provider with MSAL.JS since October 2020.

You'd have to specify extra auth properties: protocolMode: 'OIDC' and knownAuthorities: ["your-id-server.com"]. See the official docs on the parameters of @azure/msal-browser.

If you follow the official JavaScript examples then the config would look like:

auth: {
    clientId: "YOUR-CLIENT-ID",
    authority: "https://your-id-server.com",
    knownAuthorities: ["https://your-id-server.com"],
    redirectUri: "https://you-client-app.com",
    protocolMode: "OIDC"
}

HISTORY

Till this PR was merged 16-Oct-2020, MSAL worked with MS end-points exclusively. So the @leastprivilege's answer of 2017 was correct back then.

Thankfully, issue requests 1555 and subsequently 2120 helped to change the tide.

Related