protected override async Task OnInitializedAsync() { var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); if (authState.User.Identity.IsAuthenticated) { await TwitchService.LoadChannelData(); } }
/// <summary> /// OnInitializedAsync 方法 /// </summary> /// <returns></returns> protected override async System.Threading.Tasks.Task OnInitializedAsync() { if (AuthenticationStateProvider != null) { var state = await AuthenticationStateProvider.GetAuthenticationStateAsync(); UserName = state?.User.Identity !.Name; } }
public AuthenticationManager( HttpClient httpClient, ILocalStorageService localStorage, AuthenticationStateProvider authenticationStateProvider) { _httpClient = httpClient; _localStorage = localStorage; _authenticationStateProvider = authenticationStateProvider; }
public ServerAuthenticationService( AuthenticationStateProvider authenticationStateProvider, IPrincipalStorageProvider principalStorageProvider, IPrincipalProvider principalProvider) { _authenticationStateProvider = authenticationStateProvider as DelayedAuthenticationStateProvider; _principalStorageProvider = principalStorageProvider; _principalProvider = principalProvider; }
public ImageService( ApplicationDbContext dbContext, BlobStorageService blobStorage, AuthenticationStateProvider authenticationStateProvider) { this.dbContext = dbContext; this.blobStorage = blobStorage; this.authenticationStateProvider = authenticationStateProvider; }
public AuthService(HttpClient httpClient, AuthenticationStateProvider authStateProvider, ILocalStorageService localStorage) { this.httpClient = httpClient; this.authStateProvider = authStateProvider; this.localStorage = localStorage; Console.WriteLine("Created AuthService instance."); Console.WriteLine($"(AuthService) HttpClient requestheader auth: {httpClient.DefaultRequestHeaders.Authorization}"); }
public AuthService( HttpClient httpClient, ILocalStorageService localStorage, AuthenticationStateProvider authenticationStateProvider) { this.httpClient = httpClient; this.localStorage = localStorage; this.authenticationStateProvider = authenticationStateProvider; }
public AuthService(HttpClient httpClient, AuthenticationStateProvider authenticationStateProvider, ILocalStorageService localStorage, IHttpService httpService) { _httpClient = httpClient; _authenticationStateProvider = authenticationStateProvider; _localStorage = localStorage; _httptService = httpService; }
public ServerSideAuthService( IButtonActionHandlerResolver buttonActionHandlerResolver, IAuthorizationService authorizationService, AuthenticationStateProvider authenticationStateProvider) { _buttonActionHandlerResolver = buttonActionHandlerResolver; _authorizationService = authorizationService; _authenticationStateProvider = authenticationStateProvider; }
public AuthenServices(ILocalStorageService localStorage, ISessionStorageService sessionStorage, AuthenticationStateProvider authenStateProvider, IApiClientService <UserLoginModel> api, HttpClient httpClient) { _localStorage = localStorage; _sessionStorage = sessionStorage; _api = api; _httpClient = httpClient; _authenStateProvider = authenStateProvider; checktUser(); }
public UserIdService(IHttpContextAccessor httpContextAccessor, AuthenticationStateProvider authenticationStateProvider) { // https://github.com/dotnet/aspnetcore/issues/17585 // https://github.com/dotnet/aspnetcore/issues/18183 // https://github.com/dotnet/aspnetcore/issues/14090 this.User = httpContextAccessor.HttpContext?.User; this.RemoteIpAddress = httpContextAccessor.HttpContext?.Connection.RemoteIpAddress; _authenticationStateProvider = authenticationStateProvider; }
public AuthenticationUserService(IHttpService httpService, NavigationManager navigationManager, ILocalStorageService localStorageService, AuthenticationStateProvider authenticationStateProvider) { _httpClient = httpService; _navigationManager = navigationManager; _localStorageService = localStorageService; _authenticationStateProvider = authenticationStateProvider; }
public AuthService(HttpClient httpClient, AuthenticationStateProvider authenticationStateProvider, ILocalStorageService localStorage, ConfigService _configService) { _httpClient = httpClient; _authenticationStateProvider = authenticationStateProvider; _localStorage = localStorage; configService = _configService; }
public AuthService(AuthenticationStateProvider authenticationStateProvider, ServerHandler serverHandler, SignUpService signUpService, SignInService signInService) { this.authenticationStateProvider = authenticationStateProvider; this.serverHandler = serverHandler; this.signUpService = signUpService; this.signInService = signInService; }
public AuthentificationRepository(IConfiguration configuration, IHttpClientFactory httpClientFactory, ILocalStorageService localStorage, AuthenticationStateProvider authenticationStateProvider) { _ClientFactory = httpClientFactory; apiUrl = configuration.GetValue <string>(ConventionalUrls.BaseUrlConfigurationKey); _LocalStorage = localStorage; _AuthenticationStateProvider = authenticationStateProvider; }
public IdentityApiClient(HttpClient httpClient, AuthenticationStateProvider authenticationStateProvider, SignInManager <ApplicationUser> signInManager, IJSRuntime jsRuntime) { _httpClient = httpClient; _authenticationStateProvider = authenticationStateProvider; _signInManager = signInManager; _jsRuntime = jsRuntime; }
public UserIdentificationService(AuthenticationStateProvider authenticationStateProvider, ILocalStorageService localStorageService, ISyncLocalStorageService syncLocalStorageService, NavigationManager navigationManager) { _authenticationStateProvider = authenticationStateProvider; _localStorageService = localStorageService; _syncLocalStorageService = syncLocalStorageService; _localStorageKey = navigationManager.BaseUri + "MyChatApp-GuestUserName";; _authenticationStateProvider.AuthenticationStateChanged += authenticationStateProvider_AuthenticationStateChanged; }
public AuthService(AuthenticationStateProvider authenticationStateProvider, IJSRuntime jsRuntime, HttpClient httpClient, ISettingsService settingsService) { authenticationStateProvider_ = authenticationStateProvider; jsRuntime_ = jsRuntime; httpClient_ = httpClient; settingsService_ = settingsService; }
public AuthenticationService(HttpClient httpClient, AuthenticationStateProvider authenticationStateProvider, ILocalStorageService localStorage, SettingsService settings) { _localStorage = localStorage; _authenticationStateProvider = authenticationStateProvider; _httpClient = httpClient; _settings = settings; }
protected override async Task OnInitializedAsync() { // TODO: #11 Move task metadata initialization into separate service var state = await AuthenticationStateProvider .GetAuthenticationStateAsync() .ConfigureAwait(false); _task.Metadata.Id = Guid.NewGuid().ToString(); _task.Metadata.Owner = state.User.FindFirst(claim => claim.Type == ClaimTypes.Email).Value; }
protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); AuthenticationState authenticationState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); ClaimsPrincipal = authenticationState.User; CurrentUser = authenticationState.User.ToAccountListing(); CurrentToken = HttpContextAccessor?.HttpContext?.Request?.Cookies[ApiTokenAuthenticationHandler.CookieName]; }
public UserStateEffects( KeyValueStore kvs, AuthenticationStateProvider authenticationStateProvider, UrlProvider urlProvider ) { _kvs = kvs; _authenticationStateProvider = authenticationStateProvider; _urlProvider = urlProvider; }
public AuthenticationService(HttpClient client, AuthenticationStateProvider authStateProvider, ILocalStorageService localStorage, NavigationManager navManager) { _client = client; _authStateProvider = authStateProvider; _localStorage = localStorage; _navManager = navManager; }
public CategoryManager(HttpClient apiClient, AuthenticationStateProvider apiAuthenticationStateProvider) { _apiClient = apiClient; _apiAuthenticationStateProvider = apiAuthenticationStateProvider; _apiAuthenticationStateProvider.AuthenticationStateChanged += OnAuthenticationChanged; _ = GetAllCategories(); }
public OneTimeTokenService(IAdminStore <OneTimeToken> store, AuthenticationStateProvider state, IAccessTokenProvider provider, IOptions <RemoteAuthenticationOptions <OidcProviderOptions> > options) { _store = store ?? throw new ArgumentNullException(nameof(store)); _stateProvider = state ?? throw new ArgumentNullException(nameof(state)); _provider = provider ?? throw new ArgumentNullException(nameof(provider)); _options = options ?? throw new ArgumentNullException(nameof(options)); }
public AuthService(HttpClient httpClient, AuthenticationStateProvider authenticationStateProvider, ILocalStorageService localStorage, ILogger <AuthService> logger) { HttpClient = httpClient; _authenticationStateProvider = authenticationStateProvider; _localStorage = localStorage; Logger = logger; }
/// <summary> /// /// </summary> protected override async Task OnParametersSetAsync() { if (AuthenticationStateProvider != null) { var user = await AuthenticationStateProvider.GetAuthenticationStateAsync(); var url = new UriBuilder(NavigationManager?.Uri ?? "").Path; authorizated = AuthorizationServices != null && AuthorizationServices.Authorizate(user.User, url.ToMvcMenuUrl(), Key); } }
/// <summary> /// 認証状態を認証済み設定します。 /// </summary> /// <param name="provider">プロバイダ。</param> /// <param name="userId">ユーザーID。</param> /// <param name="token">トークン。</param> /// <remarks> /// <see cref="AuthenticationStateProvider.NotifyAuthenticationStateChanged"/> を呼び出すためのラップメソッド。 /// </remarks> public static void Authroize( this AuthenticationStateProvider provider, string userId, string token ) { ((CustomAuthenticationStateProvider)provider).Authroize( userId: userId, token: token ); }
public AuthenticationHttpService( AuthenticationStateProvider authenticationStateProvider, ILocalStorageService localStorage, IConfiguration config, HttpClient httpClient) { _authenticationStateProvider = authenticationStateProvider; _localStorage = localStorage; _config = config; _httpClient = httpClient; }
public HackSystemAuthenticationStateHandler( ILogger <HackSystemAuthenticationStateHandler> logger, IOptionsMonitor <HackSystemAuthenticationOptions> options, AuthenticationStateProvider authenticationStateProvider, ICookieStorageService cookieStorageService) { this.logger = logger; this.options = options.CurrentValue; this.cookieStorageService = cookieStorageService; this.authenticationStateProvider = authenticationStateProvider as IHackSystemAuthenticationStateProvider; }