public void NotifyUserAuthentication(string token)
        {
            var authenticatedUser = new ClaimsPrincipal(
                identity: new ClaimsIdentity(JwtParser.ParseClaimsFromJwt(token),
                                             authenticationType: "jwtAuthType"));

            var authState = Task.FromResult(new AuthenticationState(authenticatedUser));

            NotifyAuthenticationStateChanged(authState);
        }
        public override async Task <AuthenticationState> GetAuthenticationStateAsync()
        {
            var token = await _localStorage.GetItemAsync <string>(key : _config["authTokenStorageKey"]);

            if (string.IsNullOrWhiteSpace(token))
            {
                return(_anonymous);
            }

            _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(scheme: "bearer", parameter: token);
            return(new AuthenticationState(user: new ClaimsPrincipal(
                                               identity: new ClaimsIdentity(JwtParser.ParseClaimsFromJwt(token),
                                                                            authenticationType: "jwtAuthType"))));
        }