Skip to content

Commit 042effe

Browse files
feat: includes the “grant” property in the handler, allowing it to explicitly expose the type of grant it represents according to the contract.
1 parent e3ba936 commit 042effe

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Source/HttpsRichardy.Federation.Application/Handlers/Authorization/AuthorizationCodeGrantHandler.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
namespace HttpsRichardy.Federation.Application.Handlers.Authorization;
22

3-
public sealed class AuthorizationCodeGrantHandler(IRealmCollection realmCollection, IUserCollection userCollection, ISecurityTokenService tokenService, ITokenCollection tokenCollection) : IAuthorizationFlowHandler
3+
public sealed class AuthorizationCodeGrantHandler(IRealmCollection realmCollection, IUserCollection userCollection, ISecurityTokenService tokenService, ITokenCollection tokenCollection) :
4+
IAuthorizationFlowHandler
45
{
6+
public Grant Grant => Grant.AuthorizationCode;
7+
58
public async Task<Result<ClientAuthenticationResult>> HandleAsync(
69
ClientAuthenticationCredentials parameters, CancellationToken cancellation = default)
710
{

Source/HttpsRichardy.Federation.Application/Handlers/Authorization/ClientCredentialsGrantHandler.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
namespace HttpsRichardy.Federation.Application.Handlers.Authorization;
22

3-
public sealed class ClientCredentialsGrantHandler(IRealmCollection realmCollection, ISecurityTokenService tokenService) : IAuthorizationFlowHandler
3+
public sealed class ClientCredentialsGrantHandler(IRealmCollection realmCollection, ISecurityTokenService tokenService) :
4+
IAuthorizationFlowHandler
45
{
6+
public Grant Grant => Grant.ClientCredentials;
7+
58
public async Task<Result<ClientAuthenticationResult>> HandleAsync(ClientAuthenticationCredentials parameters, CancellationToken cancellation = default)
69
{
710
var filters = new RealmFiltersBuilder()

0 commit comments

Comments
 (0)