Esempio n. 1
0
        public bool TryValidateToken(string authorizationParameter, out Audience audience)
        {
            audience = null;
            var token = _accessTokenRepository.GetAccessToken(Guid.Parse(authorizationParameter));
            var valid = Validate(token);

            if (!valid)
            {
                return(false);
            }
            var resourceId = token.AudienceId;

            //update the accesstoken expiredOn
            _accessTokenRepository.UpdateToken(token);
            audience = UserAudienceMapper(_accessTokenRepository.GetUser(long.Parse(resourceId)));
            return(true);
        }