Package org.picketlink.identity.federation.ws.wss.secext

Examples of org.picketlink.identity.federation.ws.wss.secext.AttributedString


    Element assertion = null;
    try
    {
      RequestSecurityToken request = new RequestSecurityToken();
      request.setTokenType(URI.create(SAMLUtil.SAML2_TOKEN_TYPE));
      AttributedString as = new AttributedString();
      as.setValue("UserA");
      as.setId("UserA");
      UsernameTokenType utt = new UsernameTokenType();
      utt.setUsername(as);
      utt.setId("UserA");
      OnBehalfOfType obot = new OnBehalfOfType();
      obot.add(utt);
View Full Code Here


     * @param username a {@code String} that represents the username of the {@code UsernameTokenType}.
     * @param id an optional {@code String} that uniquely identifies the {@code UsernameTokenType}.
     * @return the constructed {@code OnBehalfOfType} instance.
     */
    public static OnBehalfOfType createOnBehalfOfWithUsername(String username, String id) {
        AttributedString attrString = new AttributedString();
        attrString.setValue(username);
        UsernameTokenType usernameToken = new UsernameTokenType();
        usernameToken.setId(id);
        usernameToken.setUsername(attrString);
        // create the OnBehalfOfType and set the UsernameTokenType.
        OnBehalfOfType onBehalfOf = new OnBehalfOfType();
View Full Code Here

                    if (!StaxParserUtil.hasTextAhead(xmlEventReader))
                        throw new ParsingException(ErrorCodes.EXPECTED_TEXT_VALUE + "userName");

                    String userName = StaxParserUtil.getElementText(xmlEventReader);

                    AttributedString attributedString = new AttributedString();
                    attributedString.setValue(userName);

                    userNameToken.setUsername(attributedString);

                    // Get the end element
                    EndElement onBehalfOfEndElement = StaxParserUtil.getNextEndElement(xmlEventReader);
View Full Code Here

        QName wsuIDQName = new QName(WSU_NS, ID, WSU_PREFIX);
        StaxUtil.writeNameSpace(writer, WSU_PREFIX, WSU_NS);
        StaxUtil.writeAttribute(writer, wsuIDQName, id);

        AttributedString userNameAttr = usernameToken.getUsername();
        if (userNameAttr == null)
            throw logger.nullValueError("User Name is null on the UsernameToken");

        StaxUtil.writeStartElement(writer, WSSE_PREFIX, USERNAME, WSSE_NS);
        StaxUtil.writeCharacters(writer, userNameAttr.getValue());
        StaxUtil.writeEndElement(writer);

        StaxUtil.writeEndElement(writer);
        StaxUtil.flush(writer);
    }
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.ws.wss.secext.AttributedString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.