Package org.opensaml

Examples of org.opensaml.SAMLAttribute


                }
                handler.handle(cb);
                attrs = cb.getAttributes();
            } else {
                //TODO Remove this after discussing
                SAMLAttribute attribute = new SAMLAttribute("Name",
                                                            "https://rahas.apache.org/saml/attrns",
                                                            null, -1,
                                                            Arrays.asList(new String[]{"Colombo/Rahas"}));
                attrs = new SAMLAttribute[]{attribute};
            }
View Full Code Here


            SAMLStatement statement = (SAMLStatement) statements.next();
            // if it is AttributeStatement, then extract the attributes
            if(statement instanceof SAMLAttributeStatement){
                Iterator attributes = ((SAMLAttributeStatement)statement).getAttributes();
                while(attributes.hasNext()){
                    SAMLAttribute attribute = (SAMLAttribute)attributes.next();
                    claims.add(attribute.getName());
                }
            }
        }
        return claims;
    }
View Full Code Here

   
                attributeStatement.setSubject(getSamlSubject(authentication));
                samlAssertion.addStatement(attributeStatement);

                for (final Entry<String, Object> e : authentication.getPrincipal().getAttributes().entrySet()) {
                    final SAMLAttribute attribute = new SAMLAttribute();
                    attribute.setName(e.getKey());
                    attribute.setNamespace(NAMESPACE);

                    if (e.getValue() instanceof Collection<?>) {
                        final Collection<?> c = (Collection<?>) e.getValue();
                        if (c.isEmpty()) {
                            // 100323 bnoordhuis: don't add the attribute, it causes a org.opensaml.MalformedException
                            continue;
                        }
                        attribute.setValues(c);
                    } else {
                        attribute.addValue(e.getValue());
                    }
   
                    attributeStatement.addAttribute(attribute);
                }
            }
View Full Code Here

        }
        handler.handle(cb);
        attrs = cb.getAttributes();
            }else{
              //TODO Remove this after discussing
                SAMLAttribute attribute = new SAMLAttribute("Name",
                        "https://rahas.apache.org/saml/attrns", null, -1, Arrays
                                .asList(new String[] { "Colombo/Rahas" }));
                attrs = new SAMLAttribute[]{attribute};
            }
           
View Full Code Here

 
  public void handle(SAMLCallback callback) throws SAMLException{
   
    if(callback.getCallbackType() == SAMLCallback.ATTR_CALLBACK){
      SAMLAttributeCallback cb = (SAMLAttributeCallback)callback;
      SAMLAttribute attribute = new SAMLAttribute("Name",
                     "https://rahas.apache.org/saml/attrns", null, -1, Arrays
                             .asList(new String[] { "Custom/Rahas" }));
      cb.addAttributes(attribute);
    }else if(callback.getCallbackType() == SAMLCallback.NAME_IDENTIFIER_CALLBACK){
      SAMLNameIdentifierCallback cb = (SAMLNameIdentifierCallback)callback;
View Full Code Here

            keyInfoElem.appendChild(keyInfoContent);

            SAMLSubject subject = new SAMLSubject(null, Arrays
                    .asList(confirmationMethods), null, keyInfoElem);

            SAMLAttribute attribute = new SAMLAttribute("Name",
                    "https://rahas.apache.org/saml/attrns", null, -1, Arrays
                            .asList(new String[] { "Colombo/Rahas" }));
            SAMLAttributeStatement attrStmt = new SAMLAttributeStatement(
                    subject, Arrays.asList(new SAMLAttribute[] { attribute }));
View Full Code Here

            SAMLSubject subject = new SAMLSubject(null,
                                                  Arrays.asList(confirmationMethods),
                                                  null,
                                                  keyInfoElem);

            SAMLAttribute attribute = new SAMLAttribute("Name",
                                                        "https://rahas.apache.org/saml/attrns",
                                                        null,
                                                        -1,
                                                        Arrays.asList(new String[]{"Colombo/Rahas"}));
            SAMLAttributeStatement attrStmt = new SAMLAttributeStatement(
View Full Code Here

            // we're cheating and hardcoding the ppid value.
            // TODO: take it from the database
            if (RahasConstants.TOK_TYPE_SAML_20.equals(data.getTokenType())) {
                attrCallback.addAttributes(getSAML2Attribute("privatepersonalidentifier", "08C648FA-5C0E-4092-ABF8-E71785373CE8", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims"));
            } else {
            SAMLAttribute attribute = null;
            attribute = new SAMLAttribute("privatepersonalidentifier",
                    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims", null, -1, Arrays
                            .asList(new String[]{"uid:0"}));
            attrCallback.addAttributes(attribute);
            }           
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.opensaml.SAMLAttribute

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.