Jak sprawdzić token SAML ADFS

Obecnie generuję tokeny SAML z ADFS w następujący sposób:

 WSTrustChannelFactory factory = null;
        try
        {
            // use a UserName Trust Binding for username authentication
            factory = new WSTrustChannelFactory(
                new UserNameWSTrustBinding(SecurityMode.TransportWithMessageCredential),
                 new EndpointAddress("https://adfs.company.com/adfs/services/trust/13/usernamemixed"));

            factory.TrustVersion = TrustVersion.WSTrust13;

            factory.Credentials.UserName.UserName = "user";
            factory.Credentials.UserName.Password = "pw";


            var rst = new RequestSecurityToken
            {
                RequestType = RequestTypes.Issue,
                AppliesTo = new EndpointReference(relyingPartyId),
                KeyType = KeyTypes.Bearer
            };
            IWSTrustChannelContract channel = factory.CreateChannel();
              GenericXmlSecurityToken genericToken = channel.Issue(rst) 
               as     GenericXmlSecurityToken;
         }
        finally
        {
            if (factory != null)
            {
                try
                {
                    factory.Close();
                }
                catch (CommunicationObjectFaultedException)
                {
                    factory.Abort();
                }
            }
        }

Powiedzmy, że zbudowałem aplikację internetową, która używa tych tokenów do uwierzytelniania. O ile wiem, przepływ pracy powinien wyglądać następująco:

Wygeneruj tokenklient otrzymuje wygenerowany token (po prawidłowym zalogowaniu)token pamięci podręcznej klientaklient używa tokena do następnego logowaniaaplikacja internetowa sprawdza poprawność tokena, nie musi dzwonić do ADFS

Jak mogę sprawdzić, czy token prezentowany przez klienta jest ważny? Czy potrzebuję certyfikatu serwera ADFS do odszyfrowania tokena?

questionAnswers(2)

yourAnswerToTheQuestion