public async Task <ClientResponse> CreateClient(string accessToken, List <string> grantTypes, List <string> redirectUris, string logoutUri, string[] allowedScopes, string organizationName, string organizationEnhId) { var clientRequest = new ClientRequest { ClientName = $"{organizationName} ({organizationEnhId})", Secrets = new[] { new Secret { Type = SecretTypes.RsaPrivateKey, Value = RSAKeyGenerator.CreateNewKey(false, organizationEnhId) } }, RequireClientSecret = false, AlwaysSendClientClaims = true, GrantTypes = grantTypes, RedirectUris = redirectUris, LogoutUri = logoutUri, AllowedScopes = allowedScopes, AllowAccessTokensViaBrowser = true, AlwaysIncludeUserClaimsInIdToken = true, AllowOfflineAccess = true }; client.SetBearerToken(accessToken); return(await client.StoreClient(clientRequest)); }
public async Task <ClientResponse> CreateClient(string accessToken, List <string> grantTypes, List <string> redirectUris, string logoutUri, string[] allowedScopes) { var clientRequest = new ClientRequest { ClientName = "Dcr created client" + Guid.NewGuid(), Secrets = new[] { new Secret { Type = SecretTypes.RsaPrivateKey, Value = RSAKeyGenerator.CreateNewKey(false) } }, RequireClientSecret = true, AlwaysSendClientClaims = true, GrantTypes = grantTypes, RedirectUris = redirectUris, LogoutUri = logoutUri, AllowedScopes = allowedScopes }; _client.SetBearerToken(accessToken); return(await _client.StoreClient(clientRequest)); }