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

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

Introduction

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

Prototype

public void setCount(int count) 

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/*  ww  w .j  a v a2s  .  com*/
 * @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;
}