コード例 #1
0
 public GetTokenByRefreshTokenGrantTypeActionFixture()
 {
     IdentityModelEventSource.ShowPII = true;
     _tokenStoreStub = new Mock <ITokenStore>();
     _clientStore    = new Mock <IClientStore>();
     _getTokenByRefreshTokenGrantTypeAction = new GetTokenByRefreshTokenGrantTypeAction(
         new Mock <IEventPublisher>().Object,
         _tokenStoreStub.Object,
         new InMemoryJwksRepository(),
         new InMemoryResourceOwnerRepository(string.Empty),
         _clientStore.Object);
 }
コード例 #2
0
ファイル: TokenActions.cs プロジェクト: jjrdk/SimpleAuth
 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;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ResourceOwnersController"/> class.
 /// </summary>
 /// <param name="settings"></param>
 /// <param name="subjectBuilder"></param>
 /// <param name="resourceOwnerRepository">The resource owner repository.</param>
 /// <param name="tokenStore">The token cache</param>
 /// <param name="jwksRepository"></param>
 /// <param name="clientRepository"></param>
 /// <param name="accountFilters">The account filters.</param>
 /// <param name="eventPublisher">The event publisher.</param>
 public ResourceOwnersController(
     RuntimeSettings settings,
     ISubjectBuilder subjectBuilder,
     IResourceOwnerRepository resourceOwnerRepository,
     ITokenStore tokenStore,
     IJwksStore jwksRepository,
     IClientRepository clientRepository,
     IEnumerable <AccountFilter> accountFilters,
     IEventPublisher eventPublisher)
 {
     _refreshOperation = new GetTokenByRefreshTokenGrantTypeAction(
         eventPublisher,
         tokenStore,
         jwksRepository,
         resourceOwnerRepository,
         clientRepository);
     _resourceOwnerRepository = resourceOwnerRepository;
     _tokenStore       = tokenStore;
     _clientRepository = clientRepository;
     _eventPublisher   = eventPublisher;
     _addUserOperation = new AddUserOperation(settings, resourceOwnerRepository, accountFilters, subjectBuilder, eventPublisher);
 }