Search in sources :

Example 36 with ProcessedClaim

use of org.apache.cxf.sts.claims.ProcessedClaim in project cxf by apache.

the class JexlClaimsMapperTest method testLowerCaseClaim.

@Test
public void testLowerCaseClaim() throws IOException {
    ProcessedClaimCollection result = jcm.mapClaims("A", createClaimCollection(), "B", createProperties());
    assertNotNull(result);
    ProcessedClaim claim = findClaim(result, "http://my.schema.org/identity/claims/lowercase");
    assertNotNull(claim);
    assertNotNull(claim.getValues());
    assertEquals(2, claim.getValues().size());
    assertEquals("value2", claim.getValues().get(1));
}
Also used : ProcessedClaimCollection(org.apache.cxf.sts.claims.ProcessedClaimCollection) ProcessedClaim(org.apache.cxf.sts.claims.ProcessedClaim) Test(org.junit.Test)

Example 37 with ProcessedClaim

use of org.apache.cxf.sts.claims.ProcessedClaim in project cxf by apache.

the class JexlClaimsMapperTest method testUpperCaseClaim.

@Test
public void testUpperCaseClaim() throws IOException {
    ProcessedClaimCollection result = jcm.mapClaims("A", createClaimCollection(), "B", createProperties());
    assertNotNull(result);
    ProcessedClaim claim = findClaim(result, "http://my.schema.org/identity/claims/uppercase");
    assertNotNull(claim);
    assertNotNull(claim.getValues());
    assertEquals(2, claim.getValues().size());
    assertEquals("VALUE2", claim.getValues().get(1));
}
Also used : ProcessedClaimCollection(org.apache.cxf.sts.claims.ProcessedClaimCollection) ProcessedClaim(org.apache.cxf.sts.claims.ProcessedClaim) Test(org.junit.Test)

Example 38 with ProcessedClaim

use of org.apache.cxf.sts.claims.ProcessedClaim in project cxf by apache.

the class JexlClaimsMapperTest method testSimpleClaimCopy.

@Test
public void testSimpleClaimCopy() throws IOException {
    ProcessedClaimCollection result = jcm.mapClaims("A", createClaimCollection(), "B", createProperties());
    assertNotNull(result);
    ProcessedClaim claim = findClaim(result, "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/mail");
    assertNotNull(claim);
    assertNotNull(claim.getValues());
    assertEquals(1, claim.getValues().size());
    assertEquals("test@apache.com", claim.getValues().get(0));
}
Also used : ProcessedClaimCollection(org.apache.cxf.sts.claims.ProcessedClaimCollection) ProcessedClaim(org.apache.cxf.sts.claims.ProcessedClaim) Test(org.junit.Test)

Example 39 with ProcessedClaim

use of org.apache.cxf.sts.claims.ProcessedClaim in project cxf by apache.

the class JexlClaimsMapperTest method testValueFilter.

@Test
public void testValueFilter() throws IOException {
    ProcessedClaimCollection result = jcm.mapClaims("A", createClaimCollection(), "B", createProperties());
    assertNotNull(result);
    ProcessedClaim claim = findClaim(result, "http://my.schema.org/identity/claims/filter");
    assertEquals(2, claim.getValues().size());
    assertTrue(claim.getValues().contains("match"));
    assertTrue(claim.getValues().contains("second_match"));
}
Also used : ProcessedClaimCollection(org.apache.cxf.sts.claims.ProcessedClaimCollection) ProcessedClaim(org.apache.cxf.sts.claims.ProcessedClaim) Test(org.junit.Test)

Example 40 with ProcessedClaim

use of org.apache.cxf.sts.claims.ProcessedClaim in project cxf by apache.

the class JexlClaimsMapperTest method testSingleToMultiValue.

@Test
public void testSingleToMultiValue() throws IOException {
    ProcessedClaimCollection result = jcm.mapClaims("A", createClaimCollection(), "B", createProperties());
    assertNotNull(result);
    ProcessedClaim claim = findClaim(result, "http://my.schema.org/identity/claims/single2multi");
    assertNotNull(claim);
    assertNotNull(claim.getValues());
    assertEquals(3, claim.getValues().size());
    assertEquals("Value2", claim.getValues().get(1));
}
Also used : ProcessedClaimCollection(org.apache.cxf.sts.claims.ProcessedClaimCollection) ProcessedClaim(org.apache.cxf.sts.claims.ProcessedClaim) Test(org.junit.Test)

Aggregations

ProcessedClaim (org.apache.cxf.sts.claims.ProcessedClaim)46 ProcessedClaimCollection (org.apache.cxf.sts.claims.ProcessedClaimCollection)35 ArrayList (java.util.ArrayList)15 Claim (org.apache.cxf.rt.security.claims.Claim)12 Test (org.junit.Test)12 URI (java.net.URI)11 ClaimsParameters (org.apache.cxf.sts.claims.ClaimsParameters)9 ClaimCollection (org.apache.cxf.rt.security.claims.ClaimCollection)8 ClaimsManager (org.apache.cxf.sts.claims.ClaimsManager)6 CustomTokenPrincipal (org.apache.wss4j.common.principal.CustomTokenPrincipal)6 Principal (java.security.Principal)5 LdapClaimsHandler (org.apache.cxf.sts.claims.LdapClaimsHandler)5 List (java.util.List)4 X500Principal (javax.security.auth.x500.X500Principal)3 Connection (org.forgerock.opendj.ldap.Connection)3 BindResult (org.forgerock.opendj.ldap.responses.BindResult)3 SearchResultEntry (org.forgerock.opendj.ldap.responses.SearchResultEntry)3 ConnectionEntryReader (org.forgerock.opendj.ldif.ConnectionEntryReader)3 GuestPrincipal (ddf.security.principal.GuestPrincipal)2 AttributeBean (org.apache.wss4j.common.saml.bean.AttributeBean)2