/// <summary> /// Initializes a new instance of the <see cref="RequestHeaderHelper"/> class. /// </summary> /// <param name="systemSettingsStore"></param> /// <param name="configuration"></param> public RequestHeaderHelper( ISystemSettingsStore systemSettingsStore, IEmConfiguration configuration) { this.systemSettingsStore = systemSettingsStore; this.configuration = configuration; }
/// <summary> /// Initializes a new instance of the <see cref="ServiceAgent"/> class. /// </summary> /// <param name="configuration"></param> /// <param name="clientFactory"></param> public ServiceAgent( IEmConfiguration configuration, IHttpClientFactory clientFactory) { this.configuration = configuration; this.clientFactory = clientFactory; this.hostSettings = this.configuration.ToHostSettings(); }
/// <summary> /// Initializes a new instance of the <see cref="AuthenticationStore"/> class. /// </summary> /// <param name="authenticationServiceAgent"></param> /// <param name="loggingServiceAgent"></param> /// <param name="configuration"></param> public AuthenticationStore( IAuthenticationServiceAgent authenticationServiceAgent, ILoggingServiceAgent loggingServiceAgent, IEmConfiguration configuration) : base(loggingServiceAgent) { this.authenticationServiceAgent = authenticationServiceAgent; this.configuration = configuration; }
/// <summary> /// Creates predefined Facebook OAuth2 authenticator. /// </summary> /// <param name="configuration"></param> /// <returns></returns> public static OAuth2Authenticator CreateFacebookOAuth2Authenticator(IEmConfiguration configuration) { AuthenticationState = new OAuth2Authenticator( clientId: configuration.FacebookAppId, scope: "email", authorizeUrl: new Uri("https://www.facebook.com/dialog/oauth/"), redirectUrl: new Uri(configuration.FacebookRedirectUrl), getUsernameAsync: null, isUsingNativeUI: true) { AllowCancel = true, ShowErrors = false, }; return(AuthenticationState); }
/// <summary> /// Initializes a new instance of the <see cref="AccountViewModel"/> class. /// </summary> /// <param name="navigationService"></param> /// <param name="systemSettingsStore"></param> /// <param name="localizer"></param> /// <param name="authenticationStore"></param> /// <param name="configuration"></param> public AccountViewModel( INavigationService navigationService, ISystemSettingsStore systemSettingsStore, ILocalizer localizer, IAuthenticationStore authenticationStore, IEmConfiguration configuration) : base(navigationService, systemSettingsStore, localizer) { this.AuthenticationStore = authenticationStore; this.Configuration = configuration; this.GoToLoginPageCommand = new DelegateCommand(() => this.NavigationService.NavigateAsync("LoginPage")); this.GoToRegisterPageCommand = new DelegateCommand(() => this.NavigationService.NavigateAsync("RegisterPage")); this.LoginWithFacebookCommand = new DelegateCommand(() => this.LoginWithFacebook()); this.LoginWithGoogleCommand = new DelegateCommand(() => this.LoginWithGoogle()); }
/// <summary> /// Creates predefined Google OAuth2 authenticator. /// </summary> /// <param name="configuration"></param> /// <returns></returns> public static OAuth2Authenticator CreateGoogleOAuth2Authenticator(IEmConfiguration configuration) { AuthenticationState = new OAuth2Authenticator( clientId: configuration.GoogleClientId, clientSecret: string.Empty, scope: "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile", authorizeUrl: new Uri("https://accounts.google.com/o/oauth2/v2/auth"), redirectUrl: new Uri(configuration.GoogleRedirectUrl), accessTokenUrl: new Uri("https://www.googleapis.com/oauth2/v4/token"), isUsingNativeUI: true) { AllowCancel = true, ShowErrors = false, }; return(AuthenticationState); }
/// <summary> /// Initializes a new instance of the <see cref="AuthenticationServiceAgent"/> class. /// </summary> /// <param name="configuration"></param> /// <param name="clientFactory"></param> public AuthenticationServiceAgent( IEmConfiguration configuration, IHttpClientFactory clientFactory) : base(configuration, clientFactory) { }
public DogsServiceAgent( IEmConfiguration configuration, IHttpClientFactory clientFactory) : base(configuration, clientFactory) { }