Search in sources :

Example 31 with EntityRoleCriterion

use of org.opensaml.saml.criterion.EntityRoleCriterion in project cas by apereo.

the class SamlRegisteredServiceCacheKeyTests method verifyCacheKeyDynamicMetadata.

@Test
public void verifyCacheKeyDynamicMetadata() {
    val criteriaSet = new CriteriaSet();
    val entityIdCriterion = new EntityIdCriterion("https://carmenwiki.osu.edu/shibboleth");
    criteriaSet.add(entityIdCriterion);
    criteriaSet.add(new EntityRoleCriterion(SPSSODescriptor.DEFAULT_ELEMENT_NAME));
    val service = new SamlRegisteredService();
    service.setName("Example");
    service.setId(1000);
    service.setServiceId(".+");
    service.setMetadataLocation("https://mdq.something.net/entities/{0}");
    val result1 = new SamlRegisteredServiceCacheKey(service, criteriaSet);
    assertNotNull(result1.getId());
    assertNotNull(result1.toString());
    assertEquals(entityIdCriterion.getEntityId(), result1.getCacheKey());
    val result2 = new SamlRegisteredServiceCacheKey(service, criteriaSet);
    assertEquals(result1, result2);
}
Also used : lombok.val(lombok.val) SamlRegisteredService(org.apereo.cas.support.saml.services.SamlRegisteredService) CriteriaSet(net.shibboleth.utilities.java.support.resolver.CriteriaSet) EntityIdCriterion(org.opensaml.core.criterion.EntityIdCriterion) EntityRoleCriterion(org.opensaml.saml.criterion.EntityRoleCriterion) Test(org.junit.jupiter.api.Test)

Example 32 with EntityRoleCriterion

use of org.opensaml.saml.criterion.EntityRoleCriterion in project cas by apereo.

the class SamlRegisteredServiceDefaultCachingMetadataResolverTests method getCriteriaFor.

private static CriteriaSet getCriteriaFor(final String entityId) {
    val criteriaSet1 = new CriteriaSet();
    criteriaSet1.add(new EntityIdCriterion(entityId));
    criteriaSet1.add(new EntityRoleCriterion(SPSSODescriptor.DEFAULT_ELEMENT_NAME));
    return criteriaSet1;
}
Also used : lombok.val(lombok.val) CriteriaSet(net.shibboleth.utilities.java.support.resolver.CriteriaSet) EntityIdCriterion(org.opensaml.core.criterion.EntityIdCriterion) EntityRoleCriterion(org.opensaml.saml.criterion.EntityRoleCriterion)

Aggregations

EntityRoleCriterion (org.opensaml.saml.criterion.EntityRoleCriterion)32 EntityIdCriterion (org.opensaml.core.criterion.EntityIdCriterion)30 CriteriaSet (net.shibboleth.utilities.java.support.resolver.CriteriaSet)28 lombok.val (lombok.val)21 UsageCriterion (org.opensaml.security.criteria.UsageCriterion)9 SamlRegisteredService (org.apereo.cas.support.saml.services.SamlRegisteredService)8 Test (org.junit.jupiter.api.Test)8 ArrayList (java.util.ArrayList)6 SamlException (org.apereo.cas.support.saml.SamlException)4 ProtocolCriterion (org.opensaml.saml.criterion.ProtocolCriterion)4 SAMLSignatureProfileValidator (org.opensaml.saml.security.impl.SAMLSignatureProfileValidator)4 File (java.io.File)3 Slf4j (lombok.extern.slf4j.Slf4j)3 StringUtils (org.apache.commons.lang3.StringUtils)3 SamlIdPMetadataCredentialResolver (org.apereo.cas.support.saml.idp.metadata.locator.SamlIdPMetadataCredentialResolver)3 SamlIdPSamlRegisteredServiceCriterion (org.apereo.cas.support.saml.idp.metadata.locator.SamlIdPSamlRegisteredServiceCriterion)3 BasicProviderKeyInfoCredentialResolver (org.opensaml.xmlsec.keyinfo.impl.BasicProviderKeyInfoCredentialResolver)3 DEREncodedKeyValueProvider (org.opensaml.xmlsec.keyinfo.impl.provider.DEREncodedKeyValueProvider)3 DSAKeyValueProvider (org.opensaml.xmlsec.keyinfo.impl.provider.DSAKeyValueProvider)3 InlineX509DataProvider (org.opensaml.xmlsec.keyinfo.impl.provider.InlineX509DataProvider)3