title: Want to request authorization to gmail with dotnetOpenAuth
body: <p>I use dotnetOpenAuth. I want to request authorization to the user's gamil.</p>
  
  <p>Do I need to use openId first?</p>
  
  <p>Cannot find a decent tutorail. Can anyone help?</p>
  
  <p>Tried this code unsuccesfully. Anyway I don't seems to ask for Gmail scope at the auth request, so I'm confused</p>
  
  <pre><code>public void PrepareAuthorizationRequest(Uri authCallbakUrl)
  {
      var consumer = new WebConsumer(GoogleConsumerConsts.ServiceDescription, mConsumerTokenManager);
  
      // request access
      consumer.Channel.Send(consumer.PrepareRequestUserAuthorization(authCallbakUrl, null, null));
  
      throw new NoRedirectToAuthPageException();
  }
  
  public ProcessAuthorizationRequestResponse ProcessAuthorizationRequest()
  {
      ProcessAuthorizationRequestResponse response;
      // Process result from the service provider
      var consumer = new WebConsumer(GoogleConsumerConsts.ServiceDescription, mConsumerTokenManager);
      var accessTokenResponse = consumer.ProcessUserAuthorization();
  
      // If we didn't have an access token response, this wasn't called by the service provider
      if (accessTokenResponse == null)
          response = new ProcessAuthorizationRequestResponse
                         {
                             IsAuthorized = false
                         };
      else
      {
          // Extract the access token
         string accessToken = accessTokenResponse.AccessToken;
         response = new ProcessAuthorizationRequestResponse
          {
              IsAuthorized = true,
              Token = accessToken,
              Secret = mConsumerTokenManager.GetTokenSecret(accessToken)
          };
      }
      return response;
  }
  
  private string Test2()
  {
      // Process result from linked in
      var google = new WebConsumer(GoogleConsumerConsts.ServiceDescription, mConsumerTokenManager);
    //  var accessToken = GetAccessTokenForUser();
      var accessToken = String.Empty;
  
      // Retrieve the user's profile information
      var endpoint = GoogleConsumerConsts.GetGmailFeedsEndpoint;// new MessageReceivingEndpoint("http://api.linkedin.com/v1/people/~", HttpDeliveryMethods.GetRequest);
      var request = google.PrepareAuthorizedRequest(endpoint, accessToken);
      var response = request.GetResponse();
      return (new StreamReader(response.GetResponseStream())).ReadToEnd();
  }
  </code></pre>