Skip to content

Instantly share code, notes, and snippets.

@IntuitDeveloperRelations
Created May 28, 2016 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IntuitDeveloperRelations/4e24477db8653294e773fc5dcb2ff28e to your computer and use it in GitHub Desktop.
Save IntuitDeveloperRelations/4e24477db8653294e773fc5dcb2ff28e to your computer and use it in GitHub Desktop.
protected void CreateAuthorization()
{
//Remember these for later.
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls11;
HttpContext.Current.Session["consumerKey"] = consumerKey;
HttpContext.Current.Session["consumerSecret"] = consumerSecret;
HttpContext.Current.Session["oauthLink"] = OAUTH_URL;
//
IOAuthSession session = CreateSession();
IToken requestToken = session.GetRequestToken();
HttpContext.Current.Session["requestToken"] = requestToken;
tokenSecret = requestToken.TokenSecret;
var authUrl = string.Format("{0}?oauth_token={1}&oauth_callback={2}", AUTHORIZE_URL, requestToken.Token, UriUtility.UrlEncode(oauth_callback_url));
HttpContext.Current.Session["oauthLink"] = authUrl;
Response.Redirect(authUrl);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment