Use the SAML library API to create a SAML sender-vouches token, which includes the sender-vouches confirmation method. The sender-vouches confirmation method is used when a server needs to propagate the client identity or behavior of the client.
When SAML function is installed on a WebSphere® server, a SAML library API is provided. Use the library to create a SAML sender-vouches token. You can use the SAML library API to create required SAML configuration objects. Then, use those configuration objects to generate a SAML sender-vouches token.
SAMLTokenFactory samlFactory = SAMLTokenFactory.getInstance(SAMLTokenFactory.WssSamlV11Token11) RequesterConfig reqData = samlFactory.newSenderVouchesTokenGenerateConfig(); ProviderConfig samlIssuerCfg = samlFactory.newDefaultProviderConfig(“WebSphere Server”); Subject subject = com.ibm.websphere.security.auth.WSSubject.getRunAsSubject(); SAMLToken samlToken = samlFactory.newSAMLToken(subject, reqData, samlIssuerCfg);
SAMLTokenFactory samlFactory = SAMLTokenFactory.getInstance(SAMLTokenFactory.WssSamlV11Token11); RequesterConfig reqData = samlFactory.newSenderVouchesTokenGenerateConfig(); reqData.setAuthenticationMethod("Password"); //Authentication method for Assertion ProviderConfig samlIssuerCfg = samlFactory.newDefaultProviderConfig(Self issuer); CredentialConfig cred = samlFactory.newCredentialConfig (); cred.setRequesterNameID("Alice"); // SAML NameIdentifier //SAML attributes: SAMLAttribute attribute = new SAMLAttribute ("email" /* Name*/, new String[] {"joe@websphere"} /*Attribute Values in String*/,null /*Attribute Values in XML */, "WebSphere" /* Namespace*/, "email" /* format*/, "joe" /*Friendly_name */); ArrayList<SAMLAttribute> al = new ArrayList<SAMLAttribute>(); al.add(attribute); attribute = new SAMLAttribute("Membership", new String[] {"Super users", "My team"}, null, null, null, null ); al.add(attribute); cred.setSAMLAttributes(al); SAMLToken samlToken = samlFactory.newSAMLToken(cred, reqData, samlIssuerCfg);
In this information ...Related reference
| IBM Redbooks, demos, education, and more(Index) |