Example #1
0
 /// <summary>
 /// Request access token for an app key, client secret and authorization code
 /// </summary>
 /// <param name="httpContext">current application context</param>
 /// <param name="code">authorization code</param>
 /// <returns>access token</returns>
 public static string GetAccessTokenByCode(HttpContext httpContext, string code)
 {
     var webForm = new AuthenticationWebPage(httpContext, null);
     return webForm.GetAccessTokenByCode(code);
 }
Example #2
0
 /// <summary>
 /// Sends an authorization request to Constant Contact API
 /// (if access to application is granted, a code is send to Redirect URL field)
 /// (Redirect URL is one of web application url pages/methods)
 /// </summary>
 /// <param name="httpContext">current application context</param>
 /// <param name="state">state query parameter</param>
 public static void AuthorizeFromWebApplication(HttpContext httpContext, string state)
 {
      var webForm = new AuthenticationWebPage(httpContext, state);
      webForm.GetAuthorizationCode();
 }