From 1688b5a30b22dd5f2ebabddf27ee7b8b1ec33ff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20T=C3=B3th?= Date: Wed, 1 Jul 2020 09:00:26 +0200 Subject: [PATCH] ClientCollection builder methods returns with client (#13437) --- .../src/Options/ClientCollection.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Options/ClientCollection.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Options/ClientCollection.cs index b34e809eb3..9f3dd10e1d 100644 --- a/src/Identity/ApiAuthorization.IdentityServer/src/Options/ClientCollection.cs +++ b/src/Identity/ApiAuthorization.IdentityServer/src/Options/ClientCollection.cs @@ -68,11 +68,13 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer /// /// The client id for the single page application. /// The to configure the default single page application. - public void AddIdentityServerSPA(string clientId, Action configure) + public Client AddIdentityServerSPA(string clientId, Action configure) { var app = ClientBuilder.IdentityServerSPA(clientId); configure(app); - Add(app.Build()); + var client = app.Build(); + Add(client); + return client; } /// @@ -80,11 +82,13 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer /// /// The client id for the single page application. /// The to configure the default single page application. - public void AddSPA(string clientId, Action configure) + public Client AddSPA(string clientId, Action configure) { var app = ClientBuilder.SPA(clientId); configure(app); - Add(app.Build()); + var client = app.Build(); + Add(client); + return client; } /// @@ -92,11 +96,13 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer /// /// The client id for the single page application. /// The to configure the native application. - public void AddNativeApp(string clientId, Action configure) + public Client AddNativeApp(string clientId, Action configure) { var app = ClientBuilder.NativeApp(clientId); configure(app); - Add(app.Build()); + var client = app.Build(); + Add(client); + return client; } } }