Search in sources :

Example 11 with KeycloakSamlAdapter

use of org.keycloak.adapters.saml.config.KeycloakSamlAdapter in project keycloak by keycloak.

the class KeycloakSamlAdapterXMLParserTest method testAllowedClockSkewDefaultUnit.

@Test
public void testAllowedClockSkewDefaultUnit() throws Exception {
    KeycloakSamlAdapter config = parseKeycloakSamlAdapterConfig("keycloak-saml-with-allowed-clock-skew-default-unit.xml", KeycloakSamlAdapter.class);
    assertThat(config, notNullValue());
    assertThat(config.getSps(), Matchers.contains(instanceOf(SP.class)));
    SP sp = config.getSps().get(0);
    IDP idp = sp.getIdp();
    assertThat(idp.getAllowedClockSkew(), is(3));
    assertThat(idp.getAllowedClockSkewUnit(), is(TimeUnit.SECONDS));
}
Also used : IDP(org.keycloak.adapters.saml.config.IDP) KeycloakSamlAdapter(org.keycloak.adapters.saml.config.KeycloakSamlAdapter) SP(org.keycloak.adapters.saml.config.SP) Test(org.junit.Test)

Aggregations

KeycloakSamlAdapter (org.keycloak.adapters.saml.config.KeycloakSamlAdapter)11 SP (org.keycloak.adapters.saml.config.SP)11 Test (org.junit.Test)10 IDP (org.keycloak.adapters.saml.config.IDP)9 Key (org.keycloak.adapters.saml.config.Key)3 FileNotFoundException (java.io.FileNotFoundException)1 KeyPair (java.security.KeyPair)1 KeyStore (java.security.KeyStore)1 KeyStoreException (java.security.KeyStoreException)1 PrivateKey (java.security.PrivateKey)1 PublicKey (java.security.PublicKey)1 Certificate (java.security.cert.Certificate)1 CertificateException (java.security.cert.CertificateException)1 X509Certificate (java.security.cert.X509Certificate)1 HashSet (java.util.HashSet)1 Properties (java.util.Properties)1 HttpClientBuilder (org.keycloak.adapters.cloned.HttpClientBuilder)1 DefaultSamlDeployment (org.keycloak.adapters.saml.DefaultSamlDeployment)1 SamlDeployment (org.keycloak.adapters.saml.SamlDeployment)1 SslRequired (org.keycloak.common.enums.SslRequired)1