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 7439057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:38:59+00:00 2026-05-29T10:38:59+00:00

My problem occur after getting the session token from Google SECURELY Here’s what I

  • 0

My problem occur after getting the session token from Google SECURELY

Here’s what I have done.
1) Get one time token

string authSubUrl = AuthSubUtil.getRequestUrl("https://some.com/mypage.aspx", "http://gdata.youtube.com", true, true);
Response.Redirect(authSubUrl);

2) Exchange for session Token

Session["YT_Token"] = AuthSubUtil.exchangeForSessionToken(Request.QueryString["token"], getRsaKey());

The getRsaKey() is found at Using AuthSub with the .NET Client Library

3) Make YouTube request

YouTubeRequestSettings settings = new YouTubeRequestSettings("my app name", "Google.Client.ID", "Google.Youtube.DeveloperKey", (string)Session["YT_Token"]);
YouTubeRequest ytRequest = new YouTubeRequest(settings);
...
Video newVideo = new Video();
newVideo.Title = "blah";
newVideo.Tags.Add(new MediaCategory("People", YouTubeNameTable.CategorySchema));
newVideo.Description = "des";
newVideo.YouTubeEntry.Private = true;
FormUploadToken formToken = ytRequest.CreateFormUploadToken(newVideo);

This is where I get the error. At ytRequest.CreateFormUploadToken. I get this

Execution of request failed: http://gdata.youtube.com/action/GetUploadToken Google.GData.Client.GDataRequestException: Execution of request failed: http://gdata.youtube.com/action/GetUploadToken ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() 
ResponseString is yt:authenticationUnknown

The code works fine if I am NOT using a secure AuthSub (i.e. setting secure to false in step 1 and null instead of getRsaKey() in step 2). Can somebody tell me what I am missing?

Thanks so much!

  • 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-29T10:39:00+00:00Added an answer on May 29, 2026 at 10:39 am

    Solution found but there’s still one small problem.
    Solution found at http://code.google.com/p/google-gdata/issues/detail?id=393 , it’s not that obvious.

    Step 3 should look like this
    3) Make YouTube request

    YouTubeRequestSettings settings = new YouTubeRequestSettings("my app name", "Google.Client.ID", "Google.Youtube.DeveloperKey", (string)Session["YT_Token"]);
    YouTubeRequest ytRequest = new YouTubeRequest(settings);
    ytRequest.Service.RequestFactory =
                    new GAuthSubRequestFactory("youtube", "my app name")
                    { PrivateKey = getRsaKey(), Token = (string)Session["YT_Token"] };
    ...
    Video newVideo = new Video();
    ...
    FormUploadToken formToken = ytRequest.CreateFormUploadToken(newVideo);
    Form.Action = formToken.Url.Replace("http://", "https://") + "?nexturl=some page";
    

    Notice the last line. formToken.Url is always insecure. How can I get the secure upload url without having to replace it manually?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I have an address field from an Access database which has been converted
Problem: I have two spreadsheets that each serve different purposes but contain one particular
I'm having a problem with getting and dropping the first value from list in
I have 20 different methods and use datareader to read and get result from
(Problem occur in Ubuntu only. Works fine in Windows. I don't know in other
I have encountered a most annoying problem that occurs on the PWD variable when
Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has
We're having a problem getting Word documents to download in IE7/IE8 using window.open calls.
UPDATE As Mathias notes below, this exact problem has been reported and resolved here:
I have two related problems that occur in the following situation. I have a

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.