예제 #1
0
파일: JwtProvider.cs 프로젝트: mh2727/leaf
        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));
        }
예제 #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));
        }