2017-02-01 7 views
0

IDサーバ4をさまざまな外部IDプロバイダとともに使用したいと考えています。ただ一つではありません。 たとえば、1つの企業がEFSにADFSを使用し、別の企業がAZUREのIDなどを使用します。このシナリオでは、異なる外部IDプロバイダにアクセスするIDサーバのインスタンスが1つしかありません。複数の外部IDプロバイダを使用するIDサーバ4

これは可能ですかこれを試したことがありますか?そうでない場合は、これを行うサービスを知っていますか?

答えて

3

もちろんこれも可能です。 Startupクラスには、好きなだけ多くの外部IdPを登録できます。 Identity Serverのサンプルクイックスタートリポジトリも確認してください。

このコードはAzureAdとGoogleを外部IdPとして登録します。 これを設定するには、アプリケーションをdevelopers.googleおよびAzureAdに登録してアプリケーションを認証する必要があります。

app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions 
    { 
     ClientId = Configuration["AzureAd:clientid"], 
     Authority = Configuration["AzureAd:authority"], 
     ClientSecret = Configuration["AzureAd:secret"], 
     PostLogoutRedirectUri = "/signed-out", 
     AuthenticationScheme = "AzureAd", 
     ResponseType = OpenIdConnectResponseType.CodeIdToken, 
     SaveToken = true, 
    }); 

    app.UseGoogleAuthentication(new GoogleOptions 
    { 
     ClientId = Configuration["Google:clientid"], 
     ClientSecret = Configuration["Google:secret"], 
     AuthenticationScheme = "Google", 
     SaveTokens = true 
    }); 
関連する問題