예제 #1
0
        public IResultModel Hand(Claim[] claims)
        {
            var token = Build(claims);

            _logger.LogDebug("生成JwtToken:{token}", token);

            var model = new JwtTokenModel
            {
                AccessToken = token
            };

            return(ResultModel.Success(model));
        }
예제 #2
0
        public IResultModel Hand(Claim[] claims, string extendData)
        {
            var token = Build(claims);

            _logger.LogDebug("生成JwtToken:{token}", token);

            var model = new JwtTokenModel
            {
                AccessToken  = token,
                ExpiresIn    = _options.Expires * 60,
                RefreshToken = extendData
            };

            return(ResultModel.Success(model));
        }
예제 #3
0
        public IResultModel Hand(List <Claim> claims, string extendData)
        {
            var options = _configProvider.Get <AuthConfig>().Jwt;

            var token = Build(claims, options);

            _logger.LogDebug("生成JwtToken:{token}", token);

            var model = new JwtTokenModel
            {
                AccessToken  = token,
                ExpiresIn    = options.Expires * 60,
                RefreshToken = extendData
            };

            return(ResultModel.Success(model));
        }