Пример #1
0
        public SessionSecurityTicket VerifySessionToken(String SessionToken)
        {
            var authService = InfrastructureFactory.CreateAuthenticationService();

            var verificationResult = authService.VerifyToken(SessionToken);

            if (verificationResult.Status == CASResponseCode.OK)
            {
                SessionTokenInformation result = authService.GetSessionTokenInformation(SessionToken);
                return(SessionTokenInformationUtil.getSessionSecurityTicket(result));
            }
            else
            {
                var fault = new VerificationFault();
                fault.Message = "Session token is not valid";

                throw new FaultException <VerificationFault>(fault);
            }
        }
Пример #2
0
        public SessionSecurityTicket VerifySessionToken(String SessionToken)
        {
            ProviderFactory _providerFactory = ProviderFactory.Instance;
            var             service          = _providerFactory.CreateSessionServiceProvider();

            var verificationResult = service.CheckIfSessionIsValid(SessionToken);

            if (verificationResult)
            {
                Session result = service.GetSessionInformation(SessionToken);
                return(SessionTokenInformationUtil.getSessionSecurityTicket(result));
            }
            else
            {
                var fault = new VerificationFault();
                fault.Message = "Session token is not valid";

                throw new FaultException <VerificationFault>(fault);
            }
        }