Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6386057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:58:37+00:00 2026-05-25T02:58:37+00:00

My application allows users to log in using OpenID from Google or Yahoo. There’s

  • 0

My application allows users to log in using OpenID from Google or Yahoo. There’s also a feature which allows users to upload to YouTube. Some users arrive via a YouTube context with the purpose of creating something and uploading to YouTube. These users will need to authorize my application to access both the address on their Google Account via OpenID, and their YouTube account via OAuth. I’d like this to be achieved with a single authorization click for the user.

I’ve seen this done here: http://www.youtube.com/create/Xtranormal. The request sent to the Google OpenID endpoint from this app is:

https://accounts.google.com/o/openid2/auth?
openid.ns=http://specs.openid.net/auth/2.0&
openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&
openid.identity=http://specs.openid.net/auth/2.0/identifier_select&
openid.return_to=http://www.xtranormal.com/social/openid/complete/?next%3Dhttp%253A%252F%252Fyoutube.xtranormal.com%252Fytmm%252Fauth_popup_done%252F%26janrain_nonce%3D2011-08-29T16%253A35%253A53ZW0VqRw&
openid.assoc_handle=AOQobUcMlV0Hmk431QROK27UegIYqYffiPeCuZ8gsB2x5ULYP0FXuoDZ&
openid.ax.mode=fetch_request&
openid.ax.required=ext0,ext1,ext2&
openid.ax.type.ext0=http://axschema.org/namePerson/first&
openid.ax.type.ext1=http://axschema.org/namePerson/last&
openid.ax.type.ext2=http://axschema.org/contact/email&
openid.mode=checkid_setup&
openid.ns.ax=http://openid.net/srv/ax/1.0&
openid.ns.oauth=http://specs.openid.net/extensions/oauth/1.0&
openid.ns.sreg=http://openid.net/extensions/sreg/1.1&
openid.oauth.consumer=www.xtranormal.com&
openid.oauth.scope=http://gdata.youtube.com/&
openid.realm=http://www.xtranormal.com/&
openid.sreg.optional=postcode,country,nickname,email,fullname 

All the other OpenID support on the application (which works well), is written with OpenID4Java. I’ve tried to create a similar request by implementing the tips in This answer, however, I can’t for the life of me get the Google popup to ask me for YouTube, it only asks for the email address.

I’m adding the parameters from the answer by adding this message extension:

public class OAuthHybridRequest implements MessageExtension{
    public static String SCOPE_YOUTUBE = "http://gdata.youtube.com/";
    ParameterList parameters;
    public OAuthHybridRequest(String scope){
        parameters = new ParameterList();
        parameters.set(new Parameter("consumer", DeploymentProperties.getDeploymentProperty("OAUTH_CONSUMER_KEY")));
        parameters.set(new Parameter("scope", scope));
    }   
    public ParameterList getParameters() {
        return parameters;
    }
    public String getTypeUri() {
        return "http://specs.openid.net/extensions/oauth/1.0";
    }
    ...
}

Which makes my request look like this:

https://accounts.google.com/o/openid2/auth?
openid.ns=http://specs.openid.net/auth/2.0&
openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&
openid.identity=http://specs.openid.net/auth/2.0/identifier_select&
openid.return_to=http://martin.test.example.no/socialdelegation/hybrid/youtube/sso/auth?is_callback%3Dtrue%26requestedURL%3D%252Fmovieeditor%252Fscripts%252Fpopupcloser.jsp&
openid.realm=http://martin.test.example.no&
openid.assoc_handle=AOQobUcMkuyp1pVZjpF-b8dVqTfB6Y6IyOZxihsk-XD1DOq0xv06lrlPgaJEF-ITUCdJiXPi&
openid.mode=checkid_setup&
openid.ns.ext1=http://specs.openid.net/extensions/oauth/1.0&
openid.ext1.consumer=test.example.no&
openid.ext1.scope=http://gdata.youtube.com&
openid.ns.sreg=http://openid.net/sreg/1.0&
openid.sreg.required=fullname,nickname,email&
openid.ns.ext3=http://openid.net/srv/ax/1.0&
openid.ext3.mode=fetch_request&
openid.ext3.type.email=http://axschema.org/contact/email&
openid.ext3.type.firstName=http://axschema.org/namePerson/first&
openid.ext3.type.lastName=http://axschema.org/namePerson/last&
openid.ext3.type.userName=http://axschema.org/namePerson/friendly&
openid.ext3.type.gender=http://axschema.org/person/gender&
openid.ext3.type.fullName=http://axschema.org/namePerson&
openid.ext3.required=email,firstName,lastName,userName,gender,fullName

What am I missing here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:58:37+00:00Added an answer on May 25, 2026 at 2:58 am

    Download oauth ext for openid4java zip file from here (comment 8) and add classes to your project. Then:

    // enable oauth ext for openid4java (do once)
    Message.addExtensionFactory(OAuthMessage.class);
    
    // add oauth extension to open-id request
    AuthRequest authReq = ...;
    OAuthRequest oauthRequest = OAuthRequest.createOAuthRequest();
    oauthRequest.setScopes("oauth scope");
    oauthRequest.setConsumer("oauth consumer key");
    authReq.addExtension(oauthRequest);
    
    // extract oauth request token from open-id response
    AuthSuccess authSuccess = ...;
    if (authSuccess.hasExtension(OAuthMessage.OPENID_NS_OAUTH)) {
        OAuthResponse oauthRes = (OAuthResponse) authSuccess
            .getExtension(OAuthMessage.OPENID_NS_OAUTH);
        // use this request token (without secret and verifier) and your oauth lib
        // to get oauth access token
        String oauthRequestToken = oauthRes.getRequestToken();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My ASP.NET application allows users to upload and download large files. Both procedures involve
I'm writing an application that allows users to upload images onto the server. I
I am working on a web application that allows users to upload attachments. These
Let say, I have a web application that allows users to upload images and
I have an application that allows users to upload images. The test case I
In the Android application I have written, there is a portion which allows the
I'm running a web application that allows a user to log in. The user
I have an application that allows users to write their own code in a
I am working on an application that allows users to input Japanese language characters.
I'm working on an application that allows users to add their own RSS feeds

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.