Beispiel #1
0
            public static async Task <Jwt> GenerateJwt(ClaimsIdentity identity, IJwtManager jwtManager, string email /*aka userName in IdentityCustomModel*/, JwtIssuerProps jwtProps)
            {
                var jwt = new Jwt
                {
                    id         = identity.Claims.Single(i => i.Type == JwtClaimHelper.ClaimIdentifierId).Value,
                    auth_token = await jwtManager.GenerateEncodedToken(email, identity),
                    expires_in = (int)jwtProps.ValidFor.TotalSeconds
                };

                return(jwt);
            }