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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:32:56+00:00 2026-06-10T02:32:56+00:00

When I use the Google.GData.Client .NET library and try to initiate an OAuth session

  • 0

When I use the Google.GData.Client .NET library and try to initiate an OAuth session it works fine until the session expires. It seems when I do my initial GetAccessToken request that the RefreshToken value is null.

Step1 (default.aspx):

OAuth2Parameters parameters = new OAuth2Parameters();
//<<build parameters with keys and CLIENT_IDs and such>>
string authorizationUrl = OAuthUtil.CreateOAuth2AuthorizationUrl(parameters);
Response.Redirect(authorizationUrl);

Step2 (oauth.aspx):

Session["ACCESS_CODE"] = Request.QueryString["code"];
Response.Redirect("Results.aspx");

Step3 (results.aspx)

if (Session["ACCESS_CODE"] == null)
  Response.Redirect("Default.aspx");

parameters.AccessCode = Session["ACCESS_CODE"].To_String();
OAuthUtil.GetAccessToken(parameters);
Response.Write("OAuth Access Token: " + parameters.AccessToken);
Session["ACCESS_TOKEN"] = parameters.AccessToken;
Session["REFRESH_TOKEN"] = parameters.RefreshToken;

When I inspect the code at this point my RefreshToken == null. Because of this I cannot call

OAuthUtil.RefreshAccessToken(parameters); 

without getting an error of value cannot be null.

  • 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-06-10T02:32:57+00:00Added an answer on June 10, 2026 at 2:32 am

    With the OAuth 2.0 offline flow, you only receive a refresh token the first time the user exchanges an authorization code and grants access to your app. You should store that refresh token in a database for later use.

    If at any time you need a refresh token for the user and you don’t have it in your database or the one you have is corrupt or revoked, you have to send the user back to the authorization page so that it can grant access again and provide you with a new refresh token.

    The Google Drive SDK documentation explains this process thoroughly. Also, there’s is a complete ASP.NET MVC application that you can use as reference.

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

Sidebar

Related Questions

The library is here. http://code.google.com/p/google-api-objectivec-client/ I want to use the SDK with ARC mode
I Installed the Google Data API SDK to get gdata dotnet client library for
I'm trying to use the Google Docs GData API (.NET) to upload a file
I'm using the google-gdata .NET library for integrating with Google Docs. It's working out
i am trying to use Google OAuth to import a user 's contacts. In
We use google-api-java-client to lookup videos and we would like to know if it
I'm trying to use the google GData api to insert an event in a
I am using the Zend GData library to integrate Google Calendar in my PHP
I'm trying to get a session token to use the Google Calendar API using
I've downloaded the Zend GData package to use the Google Calendar API. When I

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.