Package org.openid4java.message.ax

Examples of org.openid4java.message.ax.FetchRequest


        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);
        fetch.addAttribute("Email", SCHEMA_EMAIL, true);
        aReq.addExtension(fetch);
      }

      if (0 <= papeMaxAuthAge) {
        final PapeRequest pape = PapeRequest.createPapeRequest();
View Full Code Here


                if (authReq.hasExtension(AxMessage.OPENID_NS_AX))
                {
                    MessageExtension ext = authReq.getExtension(AxMessage.OPENID_NS_AX);
                    if (ext instanceof FetchRequest)
                    {
                        FetchRequest fetchReq = (FetchRequest) ext;
                        Map required = fetchReq.getAttributes(true);
                        //Map optional = fetchReq.getAttributes(false);
                        if (required.containsKey("email"))
                        {
                            Map userDataExt = new HashMap();
                            //userDataExt.put("email", userData.get(3));
View Full Code Here

            // obtain a AuthRequest message to be sent to the OpenID provider
            AuthRequest authReq = manager.authenticate(discovered, returnToUrl);

            // Attribute Exchange example: fetching the 'email' attribute
            FetchRequest fetch = FetchRequest.createFetchRequest();
            fetch.addAttribute("email", // attribute alias
                "http://schema.openid.net/contact/email", // type URI
                true); // required
            // attach the extension to the authentication request
            authReq.addExtension(fetch);
View Full Code Here

            // obtain a AuthRequest message to be sent to the OpenID provider
            AuthRequest authReq = manager.authenticate(discovered, returnToUrl);

            // Attribute Exchange example: fetching the 'email' attribute
            FetchRequest fetch = FetchRequest.createFetchRequest();
            fetch.addAttribute("email",
                    // attribute alias
                    "http://schema.openid.net/contact/email",   // type URI
                    true);                                      // required

            // attach the extension to the authentication request
View Full Code Here

            // obtain a AuthRequest message to be sent to the OpenID provider
            AuthRequest authReq = manager.authenticate(discovered, returnToUrl);

            // Attribute Exchange example: fetching the 'email' attribute
            FetchRequest fetch = FetchRequest.createFetchRequest();
            fetch.addAttribute("email",
                               "http://schema.openid.net/contact/email",   // type URI
                               true);                                      // required
           
            // attach the extension to the authentication request
            authReq.addExtension(fetch);
View Full Code Here

        return GOOGLE_GENERIC_USER_IDENTIFIER;
    }

    @Override
    protected FetchRequest getFetchRequest() throws MessageException {
        final FetchRequest fetchRequest = FetchRequest.createFetchRequest();
        fetchRequest.addAttribute(GoogleOpenIdAttributesDefinition.COUNTRY, "http://axschema.org/contact/country/home",
                true);
        fetchRequest.addAttribute(GoogleOpenIdAttributesDefinition.EMAIL, "http://axschema.org/contact/email", true);
        fetchRequest.addAttribute(GoogleOpenIdAttributesDefinition.FIRSTNAME, "http://axschema.org/namePerson/first",
                true);
        fetchRequest.addAttribute(GoogleOpenIdAttributesDefinition.LANGUAGE, "http://axschema.org/pref/language", true);
        fetchRequest.addAttribute(GoogleOpenIdAttributesDefinition.LASTNAME, "http://axschema.org/namePerson/last",
                true);
        logger.debug("fetchRequest: {}", fetchRequest);
        return fetchRequest;
    }
View Full Code Here

            // create authentication request to be sent to the OpenID provider
            final AuthRequest authRequest = this.consumerManager.authenticate(discoveryInformation,
                    contextualCallbackUrl);

            // create fetch request for attributes
            final FetchRequest fetchRequest = getFetchRequest();
            if (fetchRequest != null) {
                authRequest.addExtension(fetchRequest);
            }

            final String redirectionUrl = authRequest.getDestinationUrl(true);
View Full Code Here

        return YAHOO_GENERIC_USER_IDENTIFIER;
    }

    @Override
    protected FetchRequest getFetchRequest() throws MessageException {
        final FetchRequest fetchRequest = FetchRequest.createFetchRequest();
    fetchRequest.addAttribute(YahooOpenIdAttributesDefinition.EMAIL,
        "http://axschema.org/contact/email", true);
    fetchRequest.addAttribute(YahooOpenIdAttributesDefinition.FULLNAME,
        "http://axschema.org/namePerson", true);
    fetchRequest.addAttribute(YahooOpenIdAttributesDefinition.LANGUAGE,
        "http://axschema.org/pref/language", true);
    fetchRequest.addAttribute(YahooOpenIdAttributesDefinition.PROFILEPICTURE,
        "http://axschema.org/media/image/default", true);
   
    logger.debug("fetchRequest: {}", fetchRequest);
        return fetchRequest;
    }
View Full Code Here

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

        authReq.addExtension(sregReq);
      } else {

        FetchRequest fetch = FetchRequest.createFetchRequest();

        fetch.addAttribute(AXSchemaType.FIRSTNAME.getAlias(), AXSchemaType.FIRSTNAME.getNamespace(), true);
        fetch.addAttribute(AXSchemaType.LASTNAME.getAlias(), AXSchemaType.LASTNAME.getNamespace(), true);
        fetch.addAttribute(AXSchemaType.EMAIL.getAlias(), AXSchemaType.EMAIL.getNamespace(), true);
        fetch.addAttribute(AXSchemaType.COUNTRY.getAlias(), AXSchemaType.COUNTRY.getNamespace(), true);
        fetch.addAttribute(AXSchemaType.LANGUAGE.getAlias(), AXSchemaType.LANGUAGE.getNamespace(), true);

        // wants up to three email addresses
        fetch.setCount(AXSchemaType.EMAIL.getAlias(), 3);

        authReq.addExtension(fetch);
      }
     
      if (!discovered.isVersion2()) {
View Full Code Here

            + request.getParameter(StaticConfig.DEBUG_ARGUMENT_KEY);
      }
      System.out.println("authenticate cookies");
      AuthRequest authReq = manager.authenticate(discovered, returnUrl, null);
      System.out.println("fetch request");
      FetchRequest fetch = FetchRequest.createFetchRequest();
      System.out.println("fetching attributes");
      fetch.addAttribute("oiFirstName", "http://schema.openid.net/namePerson/first", true);
      fetch.addAttribute("oiLastName", "http://schema.openid.net/namePerson/last", true);
      fetch.addAttribute("aFirstName", "http://axschema.org/namePerson/first", true);
      fetch.addAttribute("aLastName", "http://axschema.org/namePerson/last", true);
      fetch.addAttribute("aFullName", "http://axschema.org/namePerson", true);
      fetch.addAttribute("aNickName", "http://axschema.org/namePerson/friendly", true);
      fetch.addAttribute("oiNickName", "http://openid.net/schema/namePerson/friendly", true);
      fetch.addAttribute("aEmail", "http://axschema.org/contact/email", true);
      fetch.addAttribute("oiEmail", "http://schema.openid.net/contact/email", true);
     
      System.out.println("adding extension");
      authReq.addExtension(fetch);
      // redirect to OpenID for authentication
      System.out.println("sending redirect");
View Full Code Here

TOP

Related Classes of org.openid4java.message.ax.FetchRequest

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.