-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from kallayj/clientid-null-exception
Adds a specific exception when the clientId is empty.
- Loading branch information
Showing
3 changed files
with
100 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 35 additions & 35 deletions
70
src/Duende.AccessTokenManagement/ClientCredentialsTokenManagementBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. | ||
|
||
using System; | ||
using Duende.AccessTokenManagement; | ||
|
||
namespace Microsoft.Extensions.DependencyInjection; | ||
|
||
/// <summary> | ||
/// Builder for client credential clients | ||
/// </summary> | ||
public class ClientCredentialsTokenManagementBuilder | ||
{ | ||
private readonly IServiceCollection _services; | ||
|
||
/// <summary> | ||
/// ctor | ||
/// </summary> | ||
/// <param name="services"></param> | ||
public ClientCredentialsTokenManagementBuilder(IServiceCollection services) | ||
{ | ||
_services = services; | ||
} | ||
|
||
/// <summary> | ||
/// Adds a client credentials client to the token management system | ||
/// </summary> | ||
/// <param name="name"></param> | ||
/// <param name="configureOptions"></param> | ||
/// <returns></returns> | ||
public ClientCredentialsTokenManagementBuilder AddClient(string name, Action<ClientCredentialsClient> configureOptions) | ||
{ | ||
_services.Configure(name, configureOptions); | ||
return this; | ||
} | ||
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. | ||
|
||
using System; | ||
using Duende.AccessTokenManagement; | ||
|
||
namespace Microsoft.Extensions.DependencyInjection; | ||
|
||
/// <summary> | ||
/// Builder for client credential clients | ||
/// </summary> | ||
public class ClientCredentialsTokenManagementBuilder | ||
{ | ||
private readonly IServiceCollection _services; | ||
|
||
/// <summary> | ||
/// ctor | ||
/// </summary> | ||
/// <param name="services"></param> | ||
public ClientCredentialsTokenManagementBuilder(IServiceCollection services) | ||
{ | ||
_services = services; | ||
} | ||
|
||
/// <summary> | ||
/// Adds a client credentials client to the token management system | ||
/// </summary> | ||
/// <param name="name"></param> | ||
/// <param name="configureOptions"></param> | ||
/// <returns></returns> | ||
public ClientCredentialsTokenManagementBuilder AddClient(string name, Action<ClientCredentialsClient> configureOptions) | ||
{ | ||
_services.Configure(name, configureOptions); | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters