Package org.springframework.security.openid

Examples of org.springframework.security.openid.OpenIDAttribute


            /**
             * Builds the {@link OpenIDAttribute}.
             * @return
             */
            private OpenIDAttribute build() {
                OpenIDAttribute attribute = new OpenIDAttribute(name, type);
                attribute.setCount(count);
                attribute.setRequired(required);
                return attribute;
            }
View Full Code Here


        OpenIDAuthenticationToken token = mock(OpenIDAuthenticationToken.class);
        when(token.getName()).thenReturn("newOpenIdIdentifier");
        List<OpenIDAttribute> attributes = new ArrayList<OpenIDAttribute>();
        List<String> attributeValues = new ArrayList<String>();
        attributeValues.add(user.getEmail());
        OpenIDAttribute attribute = new OpenIDAttribute("email", "", attributeValues);
        attributes.add(attribute);
        when(token.getAttributes()).thenReturn(attributes);

        UserDetails userDetails = userDetailsService.loadUserDetails(token);
        assertNotNull(userDetails);
View Full Code Here

    BusinessObjectService boSvc = mock(BusinessObjectService.class);
    successHandler.setBusinessObjectService(boSvc);
    assertEquals("no email attribute has been set in the token", noEmailOrTokenError, successHandler.getActivationMessage());
   
    // add email attribute
    OpenIDAttribute emailAttr = new OpenIDAttribute("email", "email_type", values);
    attributes.add(emailAttr);
    // simulate not finding an entity with the email provided
    when(boSvc.findMatching(same(EntityEmailBo.class), anyMapOf(String.class, String.class))).thenReturn(
        Collections.<EntityEmailBo> emptyList());
    // mock entity info svc to return the mocked entity
View Full Code Here

            /**
             * Builds the {@link OpenIDAttribute}.
             * @return
             */
            private OpenIDAttribute build() {
                OpenIDAttribute attribute = new OpenIDAttribute(name, type);
                attribute.setCount(count);
                attribute.setRequired(required);
                return attribute;
            }
View Full Code Here

   * @return a list of attributes
   */
  public List<OpenIDAttribute> createAttributeList(String identifier) {
    List<OpenIDAttribute> list = new ArrayList<OpenIDAttribute>();
    if (identifier != null && identifier.matches("https://www.google.com/.*")) {
      OpenIDAttribute email = new OpenIDAttribute("email", "http://axschema.org/contact/email");
      OpenIDAttribute first = new OpenIDAttribute("firstname", "http://axschema.org/namePerson/first");
      OpenIDAttribute last = new OpenIDAttribute("lastname", "http://axschema.org/namePerson/last");
      email.setCount(1);
      email.setRequired(true);
      first.setRequired(true);
      last.setRequired(true);
      list.add(email);
      list.add(first);
      list.add(last);
    }
    return list;
View Full Code Here

TOP

Related Classes of org.springframework.security.openid.OpenIDAttribute

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.