private void InitializeFakeObjects(params IAuthenticateResourceOwnerService[] services) { _eventPublisher = new Mock <IEventPublisher>(); _eventPublisher.Setup(x => x.Publish(It.IsAny <TokenGranted>())).Returns(Task.CompletedTask); _clientStore = new Mock <IClientStore>(); _tokenStoreStub = new Mock <ITokenStore>(); _getTokenByResourceOwnerCredentialsGrantTypeAction = new GetTokenByResourceOwnerCredentialsGrantTypeAction( _clientStore.Object, _scopeRepository.Object, _tokenStoreStub.Object, new InMemoryJwksRepository(), services, _eventPublisher.Object, new TestOutputLogger("test", _outputHelper)); }
public TokenActions( RuntimeSettings simpleAuthOptions, IAuthorizationCodeStore authorizationCodeStore, IClientStore clientStore, IScopeStore scopeRepository, IJwksStore jwksStore, IResourceOwnerRepository resourceOwnerRepository, IEnumerable <IAuthenticateResourceOwnerService> resourceOwnerServices, IEventPublisher eventPublisher, ITokenStore tokenStore, IDeviceAuthorizationStore deviceAuthorizationStore, ILogger logger) { _getTokenByDeviceAuthorizationTypeAction = new GetTokenByDeviceAuthorizationTypeAction( deviceAuthorizationStore, tokenStore, jwksStore, clientStore, eventPublisher, logger); _getTokenByResourceOwnerCredentialsGrantType = new GetTokenByResourceOwnerCredentialsGrantTypeAction( clientStore, scopeRepository, tokenStore, jwksStore, resourceOwnerServices, eventPublisher, logger); _getTokenByAuthorizationCodeGrantTypeAction = new GetTokenByAuthorizationCodeGrantTypeAction( authorizationCodeStore, simpleAuthOptions, clientStore, eventPublisher, tokenStore, jwksStore); _getTokenByRefreshTokenGrantTypeAction = new GetTokenByRefreshTokenGrantTypeAction( eventPublisher, tokenStore, jwksStore, resourceOwnerRepository, clientStore); _authenticateClient = new AuthenticateClient(clientStore, jwksStore); _revokeTokenAction = new RevokeTokenAction(clientStore, tokenStore, jwksStore, logger); _jwksStore = jwksStore; _eventPublisher = eventPublisher; _tokenStore = tokenStore; }