public OAuthController(IAuthenticationService authenticationService, IRegistrationService registrationService, IGithubService githubService, IOAuthService oAuthService) { this.authenticationService = authenticationService; this.registrationService = registrationService; this.githubService = githubService; this.oAuthService = oAuthService; }
public OAuthController( IOAuthService oauthService, IOAuthClientsService ioAuthClientsService, IRegistrationService registrationService, IIdentityStatusService identityStatusService, IEmailChangeService emailChangeService, IPhoneChangeService phoneChangeService, IPasswordChangeService passwordChangeService, IPasswordResetService passwordResetService, IEmailVerificationService emailVerificationService, IPhoneVerificationService phoneVerificationService, IIdentityTokensService identityTokensService, IWebHostEnvironment webHostEnvironment) { _oauthService = oauthService; _ioAuthClientsService = ioAuthClientsService; _registrationService = registrationService; _identityStatusService = identityStatusService; _emailChangeService = emailChangeService; _phoneChangeService = phoneChangeService; _passwordChangeService = passwordChangeService; _passwordResetService = passwordResetService; _emailVerificationService = emailVerificationService; _phoneVerificationService = phoneVerificationService; _identityTokensService = identityTokensService; _webHostEnvironment = webHostEnvironment; }
/* Basic authentication * private async void SignIn(object parameter) * { * this._username = this.Username; * GetPassword(parameter); * * SignedInUser.Username = this._username; * SignedInUser.Password = this._password; * * this._userService = new UserService(); * * if (SignedInUser.IsComplete()) * { * ConfluenceToolWindow.AuthenticatedUser = await this._userService.GetAuthenticatedUserAsync(); * this._isAuthenticated = _userService.IsAuthenticated(ConfluenceToolWindow.AuthenticatedUser); * //this.ErrorMessage = !this._isAuthenticated; * } * else * { * BindingExpression be = Username.GetBindingExpression(TextBox.TextProperty); * be.UpdateSource(); * } * * if (this._isAuthenticated) * { * this._parent.ShowAfterSignIn(); * } * } */ private async void SignInOAuth(object parameter) { this._oAuthService = new OAuthService(); IToken requestToken; string authorizationUrl; try { this._baseUrl = this.ProcessBaseUrlInput(this.BaseUrl); this._oAuthService.InitializeOAuthSession(this.BaseUrl); UserSettingsHelper.WriteToUserSettings("ConfluenceBaseUrl", this.BaseUrl); requestToken = await this._oAuthService.GetRequestToken(); authorizationUrl = await this._oAuthService.GetUserAuthorizationUrlForToken(requestToken); System.Diagnostics.Process.Start(authorizationUrl); this._parent.ShowOAuthVerificationConfirmation(null, null, requestToken); } catch (OAuthException ex) { this.ErrorMessage = ex.Message; } catch (SecurityException ex) { this.ErrorMessage = ex.Message; } catch (Exception ex) { this.ErrorMessage = ex.Message; } }
public AuthenticationViewModel(IJiraToolWindowNavigatorViewModel parent, IOAuthService oAuthService, IBasicAuthenticationService basicService, IUserService userService) { this._parent = parent; this._baseUrl = UserSettingsHelper.ReadStringFromUserSettings("JiraBaseUrl"); this._baseUrlBasic = UserSettingsHelper.ReadStringFromUserSettings("JiraBaseUrl"); this._username = UserSettingsHelper.ReadStringFromUserSettings("JiraUsername"); this._oAuthService = oAuthService; this._basicService = basicService; this._userService = userService; SettingsManager settingsManager = new ShellSettingsManager(ServiceProvider.GlobalProvider); this._userSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings); this.SignInOAuthCommand = new DelegateCommand(SignInOAuth); this.SignInBasicCommand = new DelegateCommand(SignInBasic); this.HowToSetupOAuthCommand = new DelegateCommand(HowToSetupOAuth); SetPanelTitles(); }
public WechatMPApi( IMenuService menu, IOAuthService oauth, IUIService ui, IMessageService message, IMaterialService material, IBrocastMsgService brocastMsg, ITemplateMsgService templateMsg, ISubscriptionMsgService subscriptionMsg, IUserManagementService userManagement, IQrCodeService qrCode, IUrlService url, KFManagementService kfManagement ) { Debugger.Break(); Menu = menu; OAuth = oauth; JsUI = ui; Message = message; Material = material; BrocastMsg = brocastMsg; TemplateMsg = templateMsg; SubscriptionMsg = subscriptionMsg; UserManagement = userManagement; QrCode = qrCode; Url = url; KFManagement = kfManagement; }
/// <summary> /// Initializes a new instance of the OAuthWithAuthorizationCode class. /// </summary> /// <param name="clientId"> /// The client identifier corresponding to your registered application. /// </param> /// <param name="optionalClientSecret"> /// The client secret corresponding to your registered application, or null if your app is a desktop or mobile app. /// </param> /// <param name="redirectionUri"> /// The URI to which the user of the app will be redirected after receiving user consent. /// </param> /// <param name="environment">Bing Ads API environment</param> /// <remarks> /// <para> /// For more information about using a client identifier for authentication, see <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see> /// </para> /// <para> /// For web applications, redirectionUri must be within the same domain of your registered application. /// For more information, see <see href="https://tools.ietf.org/html/rfc6749#section-2.1.1">Redirection Uri section of the OAuth 2.0 spec</see>. /// </para> /// </remarks> protected OAuthWithAuthorizationCode(string clientId, string optionalClientSecret, Uri redirectionUri, ApiEnvironment?environment) : base(clientId, environment) { _optionalClientSecret = optionalClientSecret; _oauthService = new UriOAuthService(Environment); _redirectionUri = redirectionUri ?? _oauthService.RedirectionUri(); }
public AuthController(IUserRepository userRepository, IOAuthService oAuthService, ILogger <AuthController> logger) { m_userRepository = userRepository; m_oAuthService = oAuthService; m_logger = logger; }
/// <summary> /// Initializes a new instance of the <see cref="T:Sdk.Api.ApiRequestSender"/> class. /// </summary> /// <param name="configuration">Configuration.</param> /// <param name="credentials">Credentials to use in authorized requests and to refresh tokens</param> /// <param name="oauthService">OAuthService.</param> /// <param name="httpSender">HTTP instance to send API requests</param> internal ApiRequestSender(Configuration configuration, ICredentials credentials, IOAuthService oauthService, IHttpRequestSender httpSender) { _configuration = configuration; _credentials = credentials; _oauthService = oauthService; _httpSender = httpSender; }
public RegistrationService(ApplicationDbContext dbContext, IConfiguration configuration, IGithubService githubService, IOAuthService oAuthService) { this.dbContext = dbContext; this.configuration = configuration; this.githubService = githubService; this.oAuthService = oAuthService; }
public PlexMembershipProvider(IUserService userService, IOAuthService oauthService, IOAuthTokenService oauthTokenService, IMembershipService membershipService) { _userService = userService; _oauthService = oauthService; _oauthTokenService = oauthTokenService; _membershipService = membershipService; }
public OAuthAuthenticationHandler() { // StructureMap conflicted wiht the MvcRouteUnitTester and made the unit tests fail. //_service = ObjectFactory.GetInstance<IOAuthService>(); var unitOfWork = new AzureTablesUnitOfWork("DefaultEndpointsProtocol=http;AccountName=luisprompt;AccountKey=EGzUtKSo0RvBnMX4gqde8TQx0LErE9PQ5KFbo++WeURl8zPidAtt3tzQnzCSp7IH1rW8Ecct3OmNdB3gLwhA1Q=="); _service = new OAuthService(unitOfWork); }
public AccountsBaseViewModel(IUserDialogs userDialogs, IMvxMessenger mvxMessenger, AppHelper appHelper, IOAuthService oauthService, INotificationService notificationService, IAuthenticationService authenticationService) : base(userDialogs, mvxMessenger, appHelper) { _oAuthService = oauthService; _notificationService = notificationService; _authenticationService = authenticationService; // Create Reactive Commands LoginWithFacebookCommand = ReactiveCommand.CreateFromObservable <Unit, string>( (param) => { ResetCommonProps(); return(oauthService .Authenticate(new ParentFacebookOAuth2()) .Do(AuthDict => { if (!AuthDict.ContainsKey("access_token") || string.IsNullOrEmpty(AuthDict["access_token"])) { throw new OAuthInvalidAccessTokenException(); } HandleIsExecuting(true, AppResources.Login_Authenticating_Facebook, FontAwesomeFont.Facebook); }) .SelectMany(AuthDict => authenticationService.LoginWithFacebook(AuthDict["access_token"]))); }); LoginWithFacebookCommand.Subscribe(HandleAuthSuccess); LoginWithFacebookCommand.ThrownExceptions.Subscribe(HandleExceptions); LoginWithGoogleCommand = ReactiveCommand.CreateFromObservable <Unit, string>( (param) => { ResetCommonProps(); return(oauthService .Authenticate(new ParentGoogleOAuth2()) .Do(AuthDict => { if (!AuthDict.ContainsKey("access_token") || string.IsNullOrEmpty(AuthDict["access_token"])) { throw new OAuthInvalidAccessTokenException(); } HandleIsExecuting(true, AppResources.Login_Authenticating_Google, FontAwesomeFont.Google); }) .SelectMany(AuthDict => authenticationService.LoginWithGoogle(AuthDict["access_token"]))); }); LoginWithGoogleCommand.Subscribe(HandleAuthSuccess); LoginWithGoogleCommand.ThrownExceptions.Subscribe(HandleExceptions); }
public OkonkwoOAuthMessageHandler(IOAuthService oauthSvc, string accessToken, string accessTokenSecret) : base(new HttpClientHandler()) { _oauthSvc = oauthSvc; _accessTokenSecret = accessTokenSecret; _accessToken = accessToken; }
public PlexMembershipProvider() { _userService = EngineContext.Current.Resolve <IUserService>(); _oauthService = EngineContext.Current.Resolve <IOAuthService>(); _oauthTokenService = EngineContext.Current.Resolve <IOAuthTokenService>(); _membershipService = EngineContext.Current.Resolve <IMembershipService>(); }
public IdentityController(IOAuthService authenticationService, IConfiguration configuration, INotificator notifications) : base(notifications) { _configuration = configuration; _authenticationService = authenticationService; }
protected BaseService(IReportRepository reportRepository, ITaxRepository taxRepository, IOAuthService oAuthService, string entityName) { _reportRepository = reportRepository; _log = LogManager.GetLogger(GetType()); EntityName = entityName; _taxRepository = taxRepository; _oAuthService = oAuthService; }
public OAuthClient(string serviceUri) { _serviceUri = serviceUri; ServiceProxy <IOAuthService> proxy = new ServiceProxy <IOAuthService>(serviceUri); _service = proxy.GetService(); }
public PhotosController(IOAuthService oAuthService, IPhotosApi photosApi, IConfiguration configuration, ILogger <PhotosController> logger, ClientInfo clientInfo) { _oAuthService = oAuthService; _photosApi = photosApi; Configuration = configuration; _logger = logger; _clientInfo = clientInfo; }
public SignInController( IOAuthService oauthService, IBooksService booksService ) { _oauthService = oauthService; _booksService = booksService; }
/// <summary> /// /// </summary> public UserInfoService(IOptionsMonitor <AppConfig> options, IOAuthService oAuthService, IUserInfoData userInfoData) { _userInfoData = userInfoData; _oathService = oAuthService; _config = options.CurrentValue; }
internal OAuthDesktopMobileAuthCodeGrant( string clientId, Uri redirectUri, IOAuthService oauthService, ApiEnvironment env, bool requireLiveConnect = false) : base(clientId, null, redirectUri, oauthService, env, requireLiveConnect) { }
public void Setup() { _inintializer = new OAuthInintializer(); FakeUnitOfWorkFactory unitOfWorkFactory = new FakeUnitOfWorkFactory(); IUserRepository userRepository = new FakeUserRepository(unitOfWorkFactory); IOAuthMembershipRepository oAuthMembershipRepository = new FakeOAuthMembershipRepository(unitOfWorkFactory); _oAuthService = new OAuthService(unitOfWorkFactory, userRepository, oAuthMembershipRepository); }
/// <summary> /// Initializes a new instance of the OAuthDesktopMobileImplicitGrant class with the specified ClientId. /// </summary> /// <param name="clientId"> /// The client identifier corresponding to your registered application. /// </param> /// <param name="environment">Bing Ads API environment</param> /// <remarks> /// For more information about using a client identifier for authentication, see /// <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see>. /// </remarks> public OAuthDesktopMobileImplicitGrant( string clientId, ApiEnvironment?environment = ApiEnvironment.Production, bool requireLiveConnect = false) : base(clientId, environment, requireLiveConnect) { _oauthService = new UriOAuthService(Environment); _redirectionUri = _oauthService.RedirectionUri(requireLiveConnect); }
public AccountController(IUserAuthDomainServiceProxy userAuthDomainServiceProxy, IOAuthService oAuthService, IEmailService emailService, IHttpService httpService, IUserDomainServiceProxy userDomainServiceProxy) { _userAuthDomainServiceProxy = userAuthDomainServiceProxy; _oAuthService = oAuthService; _emailService = emailService; _httpService = httpService; _userDomainServiceProxy = userDomainServiceProxy; }
/// <summary> /// Initializes a new instance of the <see cref="T:Sdk.Service.Client"/> class. /// </summary> /// <param name="configuration">Client configuration.</param> public BynderClient(Configuration configuration) { new ConfigurationValidator().Validate(configuration); _configuration = configuration; _credentials = new Credentials(); _requestSender = ApiRequestSender.Create(_configuration, _credentials, this); _assetService = new AssetService(_requestSender); _collectionService = new CollectionService(_requestSender); _oauthService = new OAuthService(_configuration, _credentials, _requestSender); }
public UsersController( IUserService userService, IOAuthService oAuthService, UserManager <User> userManager) { this._logger = LogManager.GetLogger("apiLogger"); this._userService = userService; this._oAuthService = oAuthService; this._userManager = userManager; }
/// <summary> /// /// </summary> public UserController(IHttpContextAccessor httpContext, IOptionsMonitor <AppConfig> options, IOAuthService oauthService, IUserInfoService userInfoService) { _httpContext = httpContext; _userInfoService = userInfoService; _config = options.CurrentValue; _oauthService = oauthService; }
protected BaseService(IReportRepository reportRepository, ITaxRateProvider taxRateProvider, IOAuthService oAuthService, IQBApi qb, string entityName) { _reportRepository = reportRepository; _log = LogManager.GetLogger(GetType()); EntityName = entityName; _taxRateProvider = taxRateProvider; _oAuthService = oAuthService; _qb = qb; }
internal OAuthWebAuthCodeGrant( string clientId, string clientSecret, Uri redirectionUri, IOAuthService oauthService, ApiEnvironment env, bool requireLiveConnect) : base(clientId, clientSecret, redirectionUri, oauthService, env, requireLiveConnect) { }
public AuthenticationView(JiraToolWindowNavigatorViewModel parent, IOAuthService oAuthService, IBasicAuthenticationService basicService, IUserService userService) { InitializeComponent(); this._viewModel = new AuthenticationViewModel(parent, oAuthService, basicService, userService); this.DataContext = this._viewModel; }
public OAuthController() { _oAuthUrlService = new OAuthUrlService(new SimplickrConfigurationProvider()); IHttpClient httpClient = new HttpClient(); _oAuthService = new OAuthService(_oAuthUrlService, httpClient, new QueryStringSerializer()); ISimplickrFormatter simplickrFormatter = new SimplickrJsonFormatter(); ISimplickrConfigurationProvider simplickrConfigurationProvider = new SimplickrConfigurationProvider(); var flickrRequestBuilder = new FlickrRequestUrlProvider(simplickrFormatter, simplickrConfigurationProvider); _flickrApi = new FlickrApi(new FlickrApiInvoker(flickrRequestBuilder, httpClient, simplickrFormatter)); }
/// <inheritdoc /> /// <summary> /// 构造 /// </summary> /// <param name="cacheManager"></param> /// <param name="dynamics365Options"></param> /// <param name="oAuthService"></param> /// <param name="asyncLocker"></param> public OAuthMessageHandler( Dynamics365Option dynamics365Options, ICacheManager cacheManager, IOAuthService oAuthService, IAsyncLocker asyncLocker) { _dynamics365Options = dynamics365Options; _cacheManager = cacheManager; _oAuthService = oAuthService; _asyncLocker = asyncLocker; }
public OAuthServiceTests() { _oAuthUrlService = new OAuthUrlService(new SimplickrConfigurationProvider()); _oAuthService = new OAuthService(_oAuthUrlService, new HttpClient(), new QueryStringSerializer()); _callbackUrl = "http://portfotolio.local/-oauth/authorize"; ISimplickrFormatter simplickrFormatter = new SimplickrJsonFormatter(); ISimplickrConfigurationProvider simplickrConfigurationProvider = new SimplickrConfigurationProvider(); var flickrRequestBuilder = new FlickrRequestUrlProvider(simplickrFormatter, simplickrConfigurationProvider); IHttpClient httpClient = new HttpClient(); _flickrApi = new FlickrApi(new FlickrApiInvoker(flickrRequestBuilder, httpClient, simplickrFormatter)); }
/// <summary> /// ctor the Mighty /// </summary> public AuthController(IUnitOfWorkFactory<BrewgrContext> unitOfWorkFactory, IUserLoginService userLoginService, IAuthenticationService authService, IUserResolver userResolver, IOAuthService oAuthService, IUserService userService, IFacebookConnectSettings facebookConnectSettings, IEmailSender emailSender, IEmailMessageFactory emailMessageFactory) { this.UnitOfWorkFactory = unitOfWorkFactory; this.UserLoginService = userLoginService; this.AuthenticationService = authService; this.UserResolver = userResolver; this.OAuthService = oAuthService; this.UserService = userService; this.FacebookConnectSettings = facebookConnectSettings; this.EmailSender = emailSender; this.EmailMessageFactory = emailMessageFactory; }
/// <summary> /// ctor the Mighty /// </summary> public RootController(IUnitOfWorkFactory<BrewgrContext> unitOfWorkFactory, IUserLoginService userLoginService, IAuthenticationService authService, IUserResolver userResolver, IOAuthService oAuthService, IUserService userService, ISearchService searchService, IFacebookConnectSettings facebookConnectSettings, IMarketingService marketingService, IRecipeService recipeService, IEmailMessageFactory emailMessageFactory, IEmailSender emailSender, ISeoSitemap seoSitemap) { this.UnitOfWorkFactory = unitOfWorkFactory; this.UserLoginService = userLoginService; this.AuthService = authService; this.UserResolver = userResolver; this.OAuthService = oAuthService; this.UserService = userService; this.SearchService = searchService; this.FacebookConnectSettings = facebookConnectSettings; this.MarketingService = marketingService; this.RecipeService = recipeService; this.EmailMessageFactory = emailMessageFactory; this.EmailSender = emailSender; this.SeoSitemap = seoSitemap; }
public ApplicationWebService(IOAuthService service) { modService = service; }
public void SetUp() { _oAuthUserOne = RMM.GenerateStub<IOAuthUser>(); _oAuthUserOne.Id = "Id1"; _oAuthUserOne.UserName = "******"; _oAuthUserOne.FullName = "User One Of America"; _oAuthUserOne.AccessToken = "72157626737672178-oneoneoneoneone1"; _oAuthUserOne.AccessTokenSecret = "111111111111111"; _oAuthService = RMM.GenerateStub<IOAuthService>(); _oAuthService.Stub(s => s.GetOAuthAuthenticationUrl(null)).IgnoreArguments().Return(OAuthURL); _oAuthService.Stub(s => s.GetOAuthUser(@"72157626737672178-oneoneoneoneone1", @"5d1b96a26b494074")).Return(_oAuthUserOne); _userOneTags = new List<string> { "children", "school", "parents" }; _photoOne = RMM.GenerateStub<IPhoto>(); _photoOne.Id = @"PhotoIdOne"; _photoOne.Name = @"PhotoIdOne"; _photoOne.LargeUrl = @"http://www.flickr.com/large/one.jpg"; _photoOne.ThumbNailUrl = @"http://www.flickr.com/tn/one.jpg"; _photoOne.Owner = _oAuthUserOne; _photoOne.Tags = new List<string> { "children", "school" }; _photoTwo = RMM.GenerateStub<IPhoto>(); _photoTwo.Id = @"PhotoIdTwo"; _photoTwo.Name = @"PhotoIdTwo"; _photoTwo.LargeUrl = @"http://www.flickr.com/large/two.jpg"; _photoTwo.ThumbNailUrl = @"http://www.flickr.com/tn/two.jpg"; _photoTwo.Owner = _oAuthUserOne; _photoTwo.Tags = new List<string> { "parents" }; _photoThree = RMM.GenerateStub<IPhoto>(); _photoThree.Id = @"PhotoIdThree"; _photoThree.Name = @"PhotoIdThree"; _photoThree.LargeUrl = @"http://www.flickr.com/large/three.jpg"; _photoThree.ThumbNailUrl = @"http://www.flickr.com/tn/three.jpg"; _photoThree.Owner = _oAuthUserOne; _photoThree.Tags = new List<string> { "parents", "school" }; _photosUserOne = new List<IPhoto> { _photoOne, _photoTwo, _photoThree }; _photoService = RMM.GenerateMock<IPhotoService>(); _photoService.Stub(s => s.GetPhotos(_oAuthUserOne, String.Empty)).Return(_photosUserOne); _photoService.Stub(s => s.GetPhotos(_oAuthUserOne, "school")).Return(_photosUserOne.Where(p => p.Tags.Contains("school"))); _photoService.Stub(s => s.GetAllTags(_oAuthUserOne)).Return(_userOneTags); _builder = new TestControllerBuilder(); _controller = new HomeController(); _builder.InitializeController(_controller); ObjectFactory.Inject<IOAuthService>(_oAuthService); ObjectFactory.Inject<IPhotoService>(_photoService); }
internal OAuthDesktopMobileAuthCodeGrant(string clientId, IOAuthService oauthService) : base(clientId, null, LiveComOAuthService.DesktopRedirectUri, oauthService) { }
internal OAuthWithAuthorizationCode(string clientId, string clientSecret, Uri redirectionUri, IOAuthService oauthService) : base(clientId) { if (redirectionUri == null) { throw new ArgumentNullException("redirectionUri"); } _optionalClientSecret = clientSecret; _redirectionUri = redirectionUri; _oauthService = oauthService; }
internal OAuthWebAuthCodeGrant(string clientId, string clientSecret, Uri redirectionUri, IOAuthService oauthService) : base(clientId, clientSecret, redirectionUri, oauthService) { }
public AccountController(IUserService userService, IOAuthService authService) { _userService = userService; _authService = authService; }
public OAuthController(IOAuthService service) { _oAuthService = service; }
public OAuthWebApiController() { _service = ObjectFactory.GetInstance<IOAuthService>(); }