Identityserver3 - Select Identityprovider a client should use

193 views Asked by At

I now have identityserver3 setup, i have 3 identityproviders configured: - Local - Google - ADFS

I have multiple clients using Oidc-Client-JS (https://github.com/IdentityModel/oidc-client-js).

Now i would like to specify which identityprovider a client should use to login. so lets say:

  • Client A lets the user choose which provider to use
  • Client B logs in with local
  • Client C logs in with google
  • Client D logs in with ADFS

The situation of Client A is the default behavior and i have that working. My question is how do i set up clients B,C and D?

2

There are 2 answers

0
Raymond On

Check the following function in your start up see what you called your Identityprovider in my case "Google".

    public static void ConfigureIdentityProviders(IAppBuilder app, string signInAsType)
    {
        app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions
        {
            AuthenticationType = "Google",

In your client set the acr_value for idp to what ever you have set.

    let userManagerSettings: Oidc.UserManagerSettings = {
        acr_values: "idp:Google",

Now the client will automatically redirect to the correct identityprovider

0
Alain Croisetière On

According to the IdentityServer3 documentation, you need to configure the IdentityProviderRestrictions for each clients. In case of only one identity provider is configured, the IdSrv3 will automatically redirect.