Package org.openid4java.message.sreg

Examples of org.openid4java.message.sreg.SRegRequest.addAttribute()


        "gender", "postcode", "country", "language", "timezone" };
    for (int i = 0, l = attributes.length; i < l; i++) {
      String attribute = attributes[i];
      String value = httpReq.getParameter(attribute);
      if (OPTIONAL_VALUE.equals(value)) {
        sregReq.addAttribute(attribute, false);
      } else if (REQUIRED_VALUE.equals(value)) {
        sregReq.addAttribute(attribute, true);
      }
    }
View Full Code Here


      String attribute = attributes[i];
      String value = httpReq.getParameter(attribute);
      if (OPTIONAL_VALUE.equals(value)) {
        sregReq.addAttribute(attribute, false);
      } else if (REQUIRED_VALUE.equals(value)) {
        sregReq.addAttribute(attribute, true);
      }
    }

    // attach the extension to the authentication request
    if (!sregReq.getAttributes().isEmpty()) {
View Full Code Here

                Set entries = map.entrySet();
                Iterator it = entries.iterator();
                while( it.hasNext() ){
                    Map.Entry<String, String> entry = (Map.Entry<String,String>)it.next();
                    String key = (String)entry.getKey();
                    sreg.addAttribute(key.substring("openid.sreg.".length()), true); // required
                }
            }

            /* Attribute Exchange */
            FetchRequest fetch = null;
View Full Code Here

    sregReq = SRegRequest.createFetchRequest();

    if (request.getRequiredClaims() != null && request.getRequiredClaims().size() > 0) {
      for (Object requiredClaim : request.getRequiredClaims()) {
        if (requiredClaim instanceof String) {
          sregReq.addAttribute((String) requiredClaim, true);
        }
      }
    }

    if (request.getOptionalClaims() != null && request.getOptionalClaims().size() > 0) {
View Full Code Here

    }

    if (request.getOptionalClaims() != null && request.getOptionalClaims().size() > 0) {
      for (Object optionalClaim : request.getOptionalClaims()) {
        if (optionalClaim instanceof String) {
          sregReq.addAttribute((String) optionalClaim, false);
        }
      }
    }

    return sregReq;
View Full Code Here

            // attach the extension to the authentication request
            authReq.addExtension(fetch);

            // example using Simple Registration to fetching the 'email' attribute
            SRegRequest sregReq = SRegRequest.createFetchRequest();
            sregReq.addAttribute("email", true);
            authReq.addExtension(sregReq);

            if (! discovered.isVersion2() )
            {
                // Option 1: GET HTTP-redirect to the OpenID Provider endpoint
View Full Code Here

      aReq = manager.authenticate(state.discovered, state.retTo.toString());
      aReq.setRealm(state.contextUrl);

      if (requestRegistration(aReq)) {
        final SRegRequest sregReq = SRegRequest.createFetchRequest();
        sregReq.addAttribute("fullname", true);
        sregReq.addAttribute("email", true);
        aReq.addExtension(sregReq);

        final FetchRequest fetch = FetchRequest.createFetchRequest();
        fetch.addAttribute("FirstName", SCHEMA_FIRSTNAME, true);
View Full Code Here

      aReq.setRealm(state.contextUrl);

      if (requestRegistration(aReq)) {
        final SRegRequest sregReq = SRegRequest.createFetchRequest();
        sregReq.addAttribute("fullname", true);
        sregReq.addAttribute("email", true);
        aReq.addExtension(sregReq);

        final FetchRequest fetch = FetchRequest.createFetchRequest();
        fetch.addAttribute("FirstName", SCHEMA_FIRSTNAME, true);
        fetch.addAttribute("LastName", SCHEMA_LASTNAME, true);
View Full Code Here

            // attach the extension to the authentication request
            authReq.addExtension(fetch);

            // example using Simple Registration to fetching the 'email' attribute
            SRegRequest sregReq = SRegRequest.createFetchRequest();
            sregReq.addAttribute("email", true);
            authReq.addExtension(sregReq);

            if (! discovered.isVersion2() )
            {
                // Option 1: GET HTTP-redirect to the OpenID Provider endpoint
View Full Code Here

      AuthRequest authReq = manager.authenticate(discovered, returnToUrl);
     
      if (authReq.getOPEndpoint().indexOf("myopenid.com")>0) {
        SRegRequest sregReq = SRegRequest.createFetchRequest();

        sregReq.addAttribute(AXSchemaType.FULLNAME.name().toLowerCase(), true);
        sregReq.addAttribute(AXSchemaType.EMAIL.name().toLowerCase(), true);
        sregReq.addAttribute(AXSchemaType.COUNTRY.name().toLowerCase(), true);
        sregReq.addAttribute(AXSchemaType.LANGUAGE.name().toLowerCase(), true);

        authReq.addExtension(sregReq);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.