Blazor & WASM in combination to get statistics from Spotify API for performing the song analysis.
With separate microservices for auth, Spotify, user data tracking, and application, connected through gRPC with Polly.
Vous ne pouvez pas sélectionner plus de 25 sujets
Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
| 1234567891011121314151617181920212223242526 |
- using Blazored.SessionStorage;
- using System.Security.Claims;
-
- namespace NemAnBlazor
- {
- public class AuthProvider : AuthenticationStateProvider
- {
- private readonly ISessionStorageService _sessionStorage;
- public AuthProvider(ISessionStorageService sessionStorage)
- {
- _sessionStorage = sessionStorage;
- }
- public override async Task<AuthenticationState> GetAuthenticationStateAsync()
- {
- string token = await _sessionStorage.GetItemAsync<string>("token");
-
- ClaimsIdentity identity = new ();
- ClaimsPrincipal user = new (identity);
- AuthenticationState state = new(user);
-
- NotifyAuthenticationStateChanged(Task.FromResult(state));
-
- return state;
- }
- }
- }
|