public AccessTokenService(HttpClient client, IAccessTokenStore accessTokenStore, IClientCredentials clientCredentials) { this.accessTokenStore = accessTokenStore; this.clientCredentials = clientCredentials; this.client = client; client.BaseAddress = new Uri("https://localhost:5000/"); }
public AddOfficeDocumentAction(IOfficeDocumentRepository officeDocumentRepository, IIdentityServerUmaClientFactory identityServerUmaClientFactory, IAccessTokenStore accessTokenStore, IAddDocumentParameterValidator addDocumentParameterValidator) { _officeDocumentRepository = officeDocumentRepository; _identityServerUmaClientFactory = identityServerUmaClientFactory; _accessTokenStore = accessTokenStore; _addDocumentParameterValidator = addDocumentParameterValidator; }
public Authorizer(ITwitterApplicationCredentials applicationCredentials, IAccessTokenStore accessTokenStore, Factories.UserFactory userFactory) { _applicationCredentials = applicationCredentials; _accessTokenStore = accessTokenStore; _userFactory = userFactory; }
public OAuthHeaderHandler( IAccessTokenAccessor accessTokenAccessor, IAccessTokenStore accessTokenStore, IAccessTokenRefresher accessTokenRefresher = null) { _accessTokenAccessor = accessTokenAccessor ?? throw new ArgumentNullException(nameof(accessTokenAccessor)); _accessTokenStore = accessTokenStore ?? throw new ArgumentNullException(nameof(accessTokenStore)); _accessTokenRefresher = accessTokenRefresher; }
/// <summary> /// 构造函数 /// </summary> public PostConfigureTokenAuthenticationOptions(IAccessTokenStore accessTokenStore, IOptions <AccessTokenOptions> accessTokenOptions) { if (accessTokenOptions == null) { throw new ArgumentNullException(nameof(accessTokenOptions)); } this.accessTokenStore = accessTokenStore ?? throw new ArgumentNullException(nameof(accessTokenStore)); this.accessTokenOptions = accessTokenOptions.Value; }
public ValidateConfirmationLinkAction(IOfficeDocumentRepository officeDocumentRepository, IIdentityServerUmaClientFactory identityServerUmaClientFactory, IOfficeDocumentConfirmationLinkStore officeDocumentConfirmationLinkStore, IValidateConfirmationLinkParameterValidator validateConfirmationLinkParameterValidator, IAccessTokenStore tokenStore) { _officeDocumentRepository = officeDocumentRepository; _identityServerUmaClientFactory = identityServerUmaClientFactory; _officeDocumentConfirmationLinkStore = officeDocumentConfirmationLinkStore; _validateConfirmationLinkParameterValidator = validateConfirmationLinkParameterValidator; _tokenStore = tokenStore; }
public LoginCommandHandler( IStringLocalizer <LoginCommandHandler> stringLocalizer, MoneybirdApiConfiguration apiConfiguration, IAccessTokenAcquirer accessTokenAcquirer, IAccessTokenStore accessTokenStore) { _stringLocalizer = stringLocalizer; _apiConfiguration = apiConfiguration; _accessTokenAcquirer = accessTokenAcquirer; _accessTokenStore = accessTokenStore; }
public OAuthDialog(IAccessTokenStore accessTokenStore, ITwitterApplicationCredentials applicationCredentials) { _accessTokenStore = accessTokenStore; _applicationCredentials = applicationCredentials; InitializeComponent(); pinTextBox.Visibility = Visibility.Hidden; pinLbl.Visibility = Visibility.Hidden; pinInstruction.Visibility = Visibility.Hidden; _service = new TwitterService(_applicationCredentials.ConsumerKey, _applicationCredentials.ConsumerSecret); }
public OAuth2BearerTokenHandler(IAccessTokenStore tokenStore, IAccessTokenProvider tokenProvider) { if (tokenStore == null) { throw new ArgumentNullException("tokenStore"); } if (tokenProvider == null) { throw new ArgumentNullException("tokenProvider"); } this.TokenStore = tokenStore; this.TokenProvider = tokenProvider; }
/// <summary> /// 执行用户登录 /// </summary> /// <param name="context">Http上下文</param> /// <param name="accessTokenValue">访问令牌值</param> /// <returns></returns> public static string SignIn(this HttpContext context, string accessTokenValue) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (context.RequestServices == null) { throw new MissingMemberException("HttpContext.RequestServices is null"); } IAccessTokenStore accessTokenStore = context.RequestServices.GetRequiredService <IAccessTokenStore>(); return(accessTokenStore.StoreAsync(accessTokenValue).Result); }
/// <summary> /// 异步执行用户登出 /// </summary> /// <param name="context">Http上下文</param> /// <returns></returns> public static async Task SignOutAsync(this HttpContext context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (context.RequestServices == null) { throw new MissingMemberException("HttpContext.RequestServices is null"); } IAccessTokenStore accessTokenStore = context.RequestServices.GetRequiredService <IAccessTokenStore>(); string accessTokenKey = GetAccessToken(context); if (string.IsNullOrEmpty(accessTokenKey)) { return; } await accessTokenStore.RemoveAsync(accessTokenKey); }
/// <summary> /// 获取当前令牌的访问信息 /// </summary> /// <param name="context">Http上下文</param> /// <returns></returns> public static Task <string> GetAccessTokenValueAsync(this HttpContext context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (context.RequestServices == null) { throw new MissingMemberException("HttpContext.RequestServices is null"); } IAccessTokenStore accessTokenStore = context.RequestServices.GetRequiredService <IAccessTokenStore>(); string accessTokenKey = GetAccessToken(context); if (string.IsNullOrEmpty(accessTokenKey)) { throw new UnAuthorizedException(); } return(accessTokenStore.RetrieveAsync(accessTokenKey)); }
public DefaultAccessTokenEndPointService(IAccessTokenStore accessTokenStore, IAuthorizationTokenStore authorizationTokenStore) { this.accessTokenStore = accessTokenStore; this.authorizationTokenStore = authorizationTokenStore; }
public AuthenticationService(IAccessTokenStore accessTokenStore, IAppSettings appSettings) { _accessTokenStore = accessTokenStore; _appSettings = appSettings; }
public TwitterClientFactory(IAccessTokenStore accessTokenStore, ITwitterApplicationCredentials applicationCredentials) { _accessTokenStore = accessTokenStore; _applicationCredentials = applicationCredentials; }
public AccessTokenManager(IAccessTokenStore accessTokenStore, VendApplication defaultApp) { VendApplication = defaultApp; _accessTokens = new Dictionary <string, AccessTokenBag>(); _accessTokenStore = accessTokenStore; }
public GetOfficeDocumentPermissionsAction(IGetOfficeDocumentAction getOfficeDocumentAction, IIdentityServerUmaClientFactory identityServerUmaClientFactory, IAccessTokenStore accessTokenStore) { _getOfficeDocumentAction = getOfficeDocumentAction; _identityServerUmaClientFactory = identityServerUmaClientFactory; _accessTokenStore = accessTokenStore; }