new SubjectBean(subjectName, subjectNameQualifier, confirmationMethod); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Creating new subject with principal name: " + principal.getName()); subjectBean.setSubjectNameIDFormat(localSubjectNameIDFormat);
/** * Get a SubjectBean object. */ public SubjectBean getSubject(SubjectProviderParameters subjectProviderParameters) { // 1. Get the principal Principal principal = getPrincipal(subjectProviderParameters); if (principal == null) { LOG.fine("Error in getting principal"); throw new STSException("Error in getting principal", STSException.REQUEST_FAILED); } // 2. Create the SubjectBean using the principal SubjectBean subjectBean = createSubjectBean(principal, subjectProviderParameters); // 3. Create the KeyInfoBean and set it on the SubjectBean KeyInfoBean keyInfo = createKeyInfo(subjectProviderParameters); subjectBean.setKeyInfo(keyInfo); return subjectBean; }
if (subjectBean.getKeyInfo() != null || subjectBean.getSubjectConfirmationData() != null) { subjectConfData = SAML2ComponentBuilder.createSubjectConfirmationData( subjectBean.getSubjectConfirmationData(), subjectBean.getKeyInfo() ); if (subjectBean.getSubjectConfirmationNameID() != null) { subjectConfNameId = SAML2ComponentBuilder.createNameID(subjectBean.getSubjectConfirmationNameID()); String confirmationMethodStr = subjectBean.getSubjectConfirmationMethod(); if (confirmationMethodStr == null) { confirmationMethodStr = SAML2Constants.CONF_SENDER_VOUCHES;
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (int i = 0; i < callbacks.length; i++) { if (callbacks[i] instanceof SAMLCallback) { SAMLCallback callback = (SAMLCallback) callbacks[i]; callback.setSamlVersion(Version.SAML_20); callback.setIssuer(issuer); if (conditions != null) { callback.setConditions(conditions); } SubjectBean subjectBean = new SubjectBean( subject.getNameID().getValue(), subject.getNameID().getNameQualifier(), confirmationMethod ); subjectBean.setSubjectNameIDFormat(subject.getNameID().getFormat()); subjectBean.setSubjectConfirmationData(subjectConfirmationData); callback.setSubject(subjectBean); createAndSetStatement(callback); } else { throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback"); } } }
keyInfo.setCertificate(secToken.getX509Certificate()); keyInfo.setEphemeralKey(secToken.getSecret()); subjectBean = new SubjectBean("", "", ""); subjectBean.setKeyInfo(keyInfo); } else { subjectBean = null;
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (int i = 0; i < callbacks.length; i++) { if (callbacks[i] instanceof SAMLCallback) { SAMLCallback callback = (SAMLCallback) callbacks[i]; callback.setSamlVersion(SAMLVersion.VERSION_20); callback.setIssuer("alice"); String subjectName = "uid=auth_client"; SubjectBean subjectBean = new SubjectBean( subjectName, null, SAML2Constants.CONF_SENDER_VOUCHES ); callback.setSubject(subjectBean); AttributeStatementBean attrBean = new AttributeStatementBean(); if (subjectBean != null) { attrBean.setSubject(subjectBean); } AttributeBean attributeBean = new AttributeBean(); attributeBean.setQualifiedName("attribute-role"); attributeBean.setAttributeValues(Collections.singletonList((Object)"authenticated-client")); attrBean.setSamlAttributes(Collections.singletonList(attributeBean)); callback.setAttributeStatementData(Collections.singletonList(attrBean)); } } }
ConfirmationMethod confirmationMethod = confirmationMethodV1Builder.buildObject(); nameIdentifier.setNameQualifier(subjectBean.getSubjectNameQualifier()); nameIdentifier.setValue(subjectBean.getSubjectName()); nameIdentifier.setFormat(subjectBean.getSubjectNameIDFormat()); String confirmationMethodStr = subjectBean.getSubjectConfirmationMethod(); if (subjectBean.getKeyInfo() != null) { KeyInfo keyInfo = createKeyInfo(subjectBean.getKeyInfo()); subjectConfirmation.setKeyInfo(keyInfo);
KeyInfoBean keyInfoBean = subjectBean.getKeyInfo(); if (keyInfoBean != null) { X509Certificate x509Certificate = keyInfoBean.getCertificate();
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof AttributeStatementBean)) { return false; } AttributeStatementBean that = (AttributeStatementBean) o; if (attributeBeans == null && that.attributeBeans != null) { return false; } else if (attributeBeans != null && !attributeBeans.equals(that.attributeBeans)) { return false; } if (subject == null && that.subject != null) { return false; } else if (subject != null && !subject.equals(that.subject)) { return false; } return true; }
keyInfo.setCertificate(secToken.getX509Certificate()); keyInfo.setEphemeralKey(secToken.getSecret()); subjectBean = new SubjectBean("", "", ""); subjectBean.setKeyInfo(keyInfo); } else { subjectBean = null;
new SubjectBean(subjectName, SAML2Constants.NAMEID_FORMAT_UNSPECIFIED, SAML2Constants.CONF_BEARER); callbackHandler.setSubjectBean(subjectBean);
} else if (subject != null && !subject.equals(that.subject)) { return false;
new SubjectBean( subjectName, subjectQualifier, confirmationMethod ); try { KeyInfoBean keyInfo = createKeyInfo(); subjectBean.setKeyInfo(keyInfo); } catch (Exception ex) { throw new IOException("Problem creating KeyInfo: " + ex.getMessage());
new SubjectBean(subjectName, subjectNameQualifier, confirmationMethod); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Creating new subject with principal name: " + principal.getName()); subjectBean.setSubjectNameIDFormat(localSubjectNameIDFormat);
new SubjectBean( subject, subjectQualifier, confirmationMethod );
/** * Get a SubjectBean object. */ public SubjectBean getSubject(SubjectProviderParameters subjectProviderParameters) { // 1. Get the principal Principal principal = getPrincipal(subjectProviderParameters); if (principal == null) { LOG.fine("Error in getting principal"); throw new STSException("Error in getting principal", STSException.REQUEST_FAILED); } // 2. Create the SubjectBean using the principal SubjectBean subjectBean = createSubjectBean(principal, subjectProviderParameters); // 3. Create the KeyInfoBean and set it on the SubjectBean KeyInfoBean keyInfo = createKeyInfo(subjectProviderParameters); subjectBean.setKeyInfo(keyInfo); return subjectBean; }
return false; } else if (subject != null && !subject.equals(that.subject)) { return false;
new SubjectBean( subjectName, subjectQualifier, subjectConfMethod ); try { KeyInfoBean keyInfo = createKeyInfo(); subjectBean.setKeyInfo(keyInfo); } catch (Exception ex) { throw new IOException("Problem creating KeyInfo: " + ex.getMessage());
new SubjectBean( subjectName, subjectQualifier, confirmationMethod ); try { KeyInfoBean keyInfo = createKeyInfo(); subjectBean.setKeyInfo(keyInfo); } catch (Exception ex) { throw new IOException("Problem creating KeyInfo: " + ex.getMessage());
new SubjectBean( subjectName, subjectQualifier, confirmationMethod ); try { KeyInfoBean keyInfo = createKeyInfo(); subjectBean.setKeyInfo(keyInfo); } catch (Exception ex) { throw new IOException("Problem creating KeyInfo: " + ex.getMessage());