nameID.setFormat(NameIDType.EMAIL); formats.add(nameID); nameID.setFormat(NameIDType.TRANSIENT); formats.add(nameID); nameID.setFormat(NameIDType.PERSISTENT); formats.add(nameID); nameID.setFormat(NameIDType.UNSPECIFIED); formats.add(nameID); nameID.setFormat(NameIDType.X509_SUBJECT); formats.add(nameID);
format -> this.supportedNameIDs.contains(format.getFormat()))) { throw new MetadataProviderException( "UAA does not support any of the NameIDFormats specified in the metadata for entity: "
/** {@inheritDoc} */ protected void processElementContent(XMLObject samlObject, String elementContent) { NameIDFormat format = (NameIDFormat) samlObject; format.setFormat(elementContent); } }
nameIDFormat.setFormat(NameIDType.PERSISTENT); spSSODescriptor.getNameIDFormats().add(nameIDFormat); emailNameIDFormat.setFormat(NameIDType.EMAIL); spSSODescriptor.getNameIDFormats().add(emailNameIDFormat); transientNameIDFormat.setFormat(NameIDType.TRANSIENT); spSSODescriptor.getNameIDFormats().add(transientNameIDFormat);
private void setNameIDFormat(SPSSODescriptor spssoDescriptor, SAMLSSOServiceProviderDO samlssoServiceProviderDO){ List<NameIDFormat> nameIDFormats = spssoDescriptor.getNameIDFormats(); samlssoServiceProviderDO.setNameIDFormat(nameIDFormats.get(0).getFormat()); } private void setClaims(SPSSODescriptor spssoDescriptor, SAMLSSOServiceProviderDO samlssoServiceProviderDO){
public void buildNameIdFormat(IDPSSODescriptor idpSsoDesc) throws MetadataException { NameIDFormat nameIdFormat = BuilderUtil.createSAMLObject(ConfigElements.FED_METADATA_NS, ConfigElements.NAMEID_FORMAT, ""); nameIdFormat.setFormat(IDPMetadataConstant.NAME_FORMAT_ID_SAML); idpSsoDesc.getNameIDFormats().add(nameIdFormat); }
/** * Checks that Format is present. * * @param nameIDFormat * @throws ValidationException */ protected void validateFormat(NameIDFormat nameIDFormat) throws ValidationException { if (DatatypeHelper.isEmpty(nameIDFormat.getFormat())) { throw new ValidationException("Format required"); } } }
nameID.setFormat(NameIDType.EMAIL); formats.add(nameID); nameID.setFormat(NameIDType.TRANSIENT); formats.add(nameID); nameID.setFormat(NameIDType.PERSISTENT); formats.add(nameID); nameID.setFormat(NameIDType.UNSPECIFIED); formats.add(nameID); nameID.setFormat(NameIDType.X509_SUBJECT); formats.add(nameID);
/** * Checks to see if the metadata for the entity supports the required NameID format. * * @param filterContext current filter context * * @return true if the entity supports the required NameID format, false otherwise */ protected boolean isNameIDFormatSupported(ShibbolethFilteringContext filterContext) { SSODescriptor role = getEntitySSODescriptor(filterContext); if (role == null) { log.debug("entity does contain an appropriate SSO role descriptor"); return false; } List<NameIDFormat> supportedFormats = role.getNameIDFormats(); if (supportedFormats == null || supportedFormats.isEmpty()) { log.debug("entity SSO role descriptor does not list any supported NameID formats"); return false; } for (NameIDFormat supportedFormat : supportedFormats) { if (nameIdFormat.equals(supportedFormat.getFormat())) { log.debug("entity does support the NameID format '{}'", nameIdFormat); return true; } } log.debug("entity does not support the NameID format '{}'", nameIdFormat); return false; }
nameIDFormat.setFormat("urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"); idpssoDescriptor.getNameIDFormats().add(nameIDFormat);
private void setNameIDFormat(SPSSODescriptor spssoDescriptor, SAMLSSOServiceProviderDO samlssoServiceProviderDO) { List<NameIDFormat> nameIDFormats = spssoDescriptor.getNameIDFormats(); if (nameIDFormats.isEmpty()) { samlssoServiceProviderDO.setNameIDFormat(DEFAULT_NAME_ID_FORMAT); } else { samlssoServiceProviderDO.setNameIDFormat(nameIDFormats.get(0).getFormat()); } }
nameIDFormat.setFormat(NameIDType.TRANSIENT); idpssoDescriptor.getNameIDFormats().add(nameIDFormat);