Example usage for org.springframework.security.openid OpenIDAttribute OpenIDAttribute

List of usage examples for org.springframework.security.openid OpenIDAttribute OpenIDAttribute

Introduction

In this page you can find the example usage for org.springframework.security.openid OpenIDAttribute OpenIDAttribute.

Prototype

public OpenIDAttribute(String name, String type) 

Source Link

Usage

From source file:com.erudika.para.security.SimpleAxFetchListFactory.java

/**
 * A list of OpenID attributes to send in a request.
 * @param identifier a user identifier/*from  w ww  . j  av a2  s . c om*/
 * @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;
}

From source file:org.jrecruiter.web.security.UsedOpenIdAttribute.java

private UsedOpenIdAttribute(final String name, final String type) {
    openIdAttribute = new OpenIDAttribute(name, type);
    openIdAttribute.setRequired(true);//from   w  w w  . j ava  2  s. co m
}

From source file:org.mitre.provenance.openid.OpenId4JavaProxyConsumer.java

public OpenId4JavaProxyConsumer() {
    if (proxyHost != null) {
        ProxyProperties proxyProps = new ProxyProperties();
        proxyProps.setProxyHostName(proxyHost);
        proxyProps.setProxyPort(proxyPort);
        HttpClientFactory.setProxyProperties(proxyProps);
    } // End if/*from w w w  .  j  a  v a 2s  . c  o m*/

    this.consumerManager = new ConsumerManager();

    OpenIDAttribute email = new OpenIDAttribute("email", "http://axschema.org/contact/email");
    OpenIDAttribute email2 = new OpenIDAttribute("email2", "http://schema.openid.net/contact/email");
    OpenIDAttribute name = new OpenIDAttribute("name", "http://axschema.org/namePerson");
    OpenIDAttribute firstName = new OpenIDAttribute("firstName", "http://axschema.org/namePerson/first");
    OpenIDAttribute lastName = new OpenIDAttribute("lastName", "http://axschema.org/namePerson/last");

    final List<OpenIDAttribute> attributes = new ArrayList<OpenIDAttribute>();
    attributes.add(email);
    attributes.add(email2);
    attributes.add(name);
    attributes.add(firstName);
    attributes.add(lastName);

    this.attributesToFetchFactory = new AxFetchListFactory() {
        private final List<OpenIDAttribute> fetchAttrs = Collections.unmodifiableList(attributes);

        public List<OpenIDAttribute> createAttributeList(String identifier) {
            return fetchAttrs;
        }
    };
}