コード例 #1
0
 /// <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;
 }
コード例 #2
0
ファイル: ServiceAgent.cs プロジェクト: Definux/Emeraude
 /// <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();
 }
コード例 #3
0
 /// <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;
 }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
ファイル: AccountViewModel.cs プロジェクト: Definux/Emeraude
        /// <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());
        }
コード例 #6
0
        /// <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);
        }
コード例 #7
0
 /// <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)
 {
 }
コード例 #8
0
ファイル: DogsServiceAgent.cs プロジェクト: Definux/Emeraude
 public DogsServiceAgent(
     IEmConfiguration configuration,
     IHttpClientFactory clientFactory)
     : base(configuration, clientFactory)
 {
 }