Exemplo n.º 1
0
        public string IdToken(HttpContext context)
        {
            var identity    = idProvider.GetIdentity(context);
            var entitlement = entitlementService.GetEntitlement(context, identity);

            var claims = IdClaims(identity, entitlement);

            return(CreateToken(claims, expireMinutes: authenticationOptions.SessionTimeoutMinutes));
        }
Exemplo n.º 2
0
        public async Task <string> IdToken(HttpContext context)
        {
            var identity    = idProvider.GetIdentity(context);
            var entitlement = entitlementService.GetEntitlement(context, identity);

            var claims = IdClaims(identity, entitlement);

            await saver.SaveLogin(new LoginEvent(identity, jwtOptions.Issuer, claims));

            return(CreateToken(claims, expireMinutes: authenticationOptions.SessionTimeoutMinutes));
        }