/** * Create a clone of the provided claim. * * @param claim Claim to be cloned. Value cannot be null. */ public Claim(Claim claim) { if (claim == null) { throw new IllegalArgumentException("Claim cannot be null"); } claimType = claim.getClaimType(); optional = claim.isOptional(); values.addAll(claim.getValues()); }
private boolean validateClaimValues(ClaimCollection requestedClaims, ProcessedClaimCollection claims) { for (Claim claim : requestedClaims) { String claimType = claim.getClaimType(); boolean found = false; if (!claim.isOptional()) { for (ProcessedClaim c : claims) { if (c.getClaimType().equals(claimType)) { found = true; break; } } if (!found) { LOG.warning("Mandatory claim not found: " + claim.getClaimType()); throw new STSException("Mandatory claim '" + claim.getClaimType() + "' not found"); } } } return true; }
private boolean validateClaimValues(ClaimCollection requestedClaims, ProcessedClaimCollection claims) { for (Claim claim : requestedClaims) { String claimType = claim.getClaimType(); boolean found = false; if (!claim.isOptional()) { for (ProcessedClaim c : claims) { if (c.getClaimType().equals(claimType)) { found = true; break; } } if (!found) { LOG.warning("Mandatory claim not found: " + claim.getClaimType()); throw new STSException("Mandatory claim '" + claim.getClaimType() + "' not found"); } } } return true; }
/** * Create a clone of the provided claim. * * @param claim Claim to be cloned. Value cannot be null. */ public Claim(Claim claim) { if (claim == null) { throw new IllegalArgumentException("Claim cannot be null"); } claimType = claim.getClaimType(); optional = claim.isOptional(); values.addAll(claim.getValues()); }
private static boolean isClaimOverridden(ClaimBean bean, List<ClaimBean> mClaims) { for (ClaimBean methodBean : mClaims) { if (bean.getClaim().getClaimType().equals(methodBean.getClaim().getClaimType()) && bean.getClaimFormat().equals(methodBean.getClaimFormat())) { return true; } } return false; }
private static boolean isClaimOverridden(ClaimBean bean, List<ClaimBean> mClaims) { for (ClaimBean methodBean : mClaims) { if (bean.getClaim().getClaimType().equals(methodBean.getClaim().getClaimType()) && bean.getClaimFormat().equals(methodBean.getClaimFormat())) { return true; } } return false; }
public ProcessedClaimCollection retrieveClaimValues( ClaimCollection claims, ClaimsParameters parameters) { ProcessedClaimCollection claimsColl = new ProcessedClaimCollection(); for (Claim claim : claims) { if (getGlobalClaims().keySet().contains(claim.getClaimType().toString())) { ProcessedClaim c = new ProcessedClaim(); c.setClaimType(claim.getClaimType()); c.setPrincipal(parameters.getPrincipal()); c.addValue(getGlobalClaims().get(claim.getClaimType().toString())); claimsColl.add(c); } else { if (LOG.isLoggable(Level.FINER)) { LOG.finer("Unsupported claim: " + claim.getClaimType()); } } } return claimsColl; }
public ProcessedClaimCollection retrieveClaimValues( ClaimCollection claims, ClaimsParameters parameters) { ProcessedClaimCollection claimsColl = new ProcessedClaimCollection(); for (Claim claim : claims) { if (getGlobalClaims().keySet().contains(claim.getClaimType().toString())) { ProcessedClaim c = new ProcessedClaim(); c.setClaimType(claim.getClaimType()); c.setPrincipal(parameters.getPrincipal()); c.addValue(getGlobalClaims().get(claim.getClaimType().toString())); claimsColl.add(c); } else { if (LOG.isLoggable(Level.FINER)) { LOG.finer("Unsupported claim: " + claim.getClaimType()); } } } return claimsColl; }
if (endpointClaims.keySet().contains(claim.getClaimType().toString())) { ProcessedClaim c = new ProcessedClaim(); c.setClaimType(claim.getClaimType()); c.setPrincipal(parameters.getPrincipal()); c.addValue(endpointClaims.get(claim.getClaimType().toString())); claimsColl.add(c); } else { if (LOG.isLoggable(Level.FINER)) { LOG.finer("Unsupported claim: " + claim.getClaimType());
if (endpointClaims.keySet().contains(claim.getClaimType().toString())) { ProcessedClaim c = new ProcessedClaim(); c.setClaimType(claim.getClaimType()); c.setPrincipal(parameters.getPrincipal()); c.addValue(endpointClaims.get(claim.getClaimType().toString())); claimsColl.add(c); } else { if (LOG.isLoggable(Level.FINER)) { LOG.finer("Unsupported claim: " + claim.getClaimType());
private ClaimCollection filterHandlerClaims(ClaimCollection claims, List<String> handlerClaimTypes) { ClaimCollection supportedClaims = new ClaimCollection(); supportedClaims.setDialect(claims.getDialect()); for (Claim claim : claims) { if (handlerClaimTypes.contains(claim.getClaimType())) { supportedClaims.add(claim); } } return supportedClaims; }
private ClaimCollection filterHandlerClaims(ClaimCollection claims, List<String> handlerClaimTypes) { ClaimCollection supportedClaims = new ClaimCollection(); supportedClaims.setDialect(claims.getDialect()); for (Claim claim : claims) { if (handlerClaimTypes.contains(claim.getClaimType())) { supportedClaims.add(claim); } } return supportedClaims; }
protected ProcessedClaim processClaim(Claim claim, Map<String, Attribute> ldapAttributes, Principal principal) { String claimType = claim.getClaimType(); String ldapAttribute = getClaimsLdapAttributeMapping().get(claimType); Attribute attr = ldapAttributes.get(ldapAttribute); if (attr == null) { if (LOG.isLoggable(Level.FINEST)) { LOG.finest("Claim '" + claim.getClaimType() + "' is null");
protected ProcessedClaim processClaim(Claim claim, Map<String, Attribute> ldapAttributes, Principal principal) { String claimType = claim.getClaimType(); String ldapAttribute = getClaimsLdapAttributeMapping().get(claimType); Attribute attr = ldapAttributes.get(ldapAttribute); if (attr == null) { if (LOG.isLoggable(Level.FINEST)) { LOG.finest("Claim '" + claim.getClaimType() + "' is null");
if (cl instanceof SAMLClaim) { if (((SAMLClaim)cl).getName().equals(claimBean.getClaim().getClaimType()) && ((SAMLClaim)cl).getNameFormat().equals(claimBean.getClaimFormat())) { matchingClaim = cl; break; } else if (cl.getClaimType().equals(claimBean.getClaim().getClaimType())) { matchingClaim = cl; break;
if (cl instanceof SAMLClaim) { if (((SAMLClaim)cl).getName().equals(claimBean.getClaim().getClaimType()) && ((SAMLClaim)cl).getNameFormat().equals(claimBean.getClaimFormat())) { matchingClaim = cl; break; } else if (cl.getClaimType().equals(claimBean.getClaim().getClaimType())) { matchingClaim = cl; break;
List<String> claims = new ArrayList<>(); for (Claim claim : params.getRequestedPrimaryClaims()) { claims.add(claim.getClaimType().toString()); List<String> claims = new ArrayList<>(); for (Claim claim : params.getRequestedSecondaryClaims()) { claims.add(claim.getClaimType().toString());
List<String> claims = new ArrayList<>(); for (Claim claim : params.getRequestedPrimaryClaims()) { claims.add(claim.getClaimType().toString()); List<String> claims = new ArrayList<>(); for (Claim claim : params.getRequestedSecondaryClaims()) { claims.add(claim.getClaimType().toString());
if (secondaryClaim.getClaimType().equals(claim.getClaimType())) { matchingClaim = secondaryClaim; break; } else { Claim mergedClaim = new Claim(); mergedClaim.setClaimType(claim.getClaimType()); if (claim.getValues() != null && !claim.getValues().isEmpty()) { mergedClaim.setValues(claim.getValues());
if (secondaryClaim.getClaimType().equals(claim.getClaimType())) { matchingClaim = secondaryClaim; break; } else { Claim mergedClaim = new Claim(); mergedClaim.setClaimType(claim.getClaimType()); if (claim.getValues() != null && !claim.getValues().isEmpty()) { mergedClaim.setValues(claim.getValues());