Example #1
0
 /// <summary>
 /// Called just before issuing request to service when everything is ready.
 /// Allows to add extra parameters to request or do any other needed preparations.
 /// </summary>
 protected virtual void BeforeGetUserInfo(BeforeAfterRequestArgs args)
 {
 }
Example #2
0
 protected virtual void BeforeGetAccessToken(BeforeAfterRequestArgs args)
 {
     if (GrantType == "refresh_token")
     {
         args.Request.AddObject(new
         {
             refresh_token = args.Parameters.GetOrThrowUnexpectedResponse("refresh_token"),
             client_id = Configuration.ClientId,
             client_secret = Configuration.ClientSecret,
             grant_type = GrantType
         });
     }
     else
     {
         args.Request.AddObject(new
         {
             code = args.Parameters.GetOrThrowUnexpectedResponse("code"),
             client_id = Configuration.ClientId,
             client_secret = Configuration.ClientSecret,
             redirect_uri = Configuration.RedirectUri,
             grant_type = GrantType
         });
     }
 }
Example #3
0
 /// <summary>
 /// Called just after obtaining response with access token from service.
 /// Allows to read extra data returned along with access token.
 /// </summary>
 protected virtual void AfterGetAccessToken(BeforeAfterRequestArgs args)
 {
 }
Example #4
0
 protected virtual void BeforeGetAccessToken(BeforeAfterRequestArgs args)
 {
     args.Request.AddObject(new
     {
         code = args.Parameters.GetOrThrowUnexpectedResponse("code"),
         client_id = Configuration.ClientId,
         client_secret = Configuration.ClientSecret,
         redirect_uri = Configuration.RedirectUri,
         grant_type = "authorization_code"
     });
 }
Example #5
0
 /// <summary>
 /// Called just before issuing request to service when everything is ready.
 /// Allows to add extra parameters to request or do any other needed preparations.
 /// </summary>
 protected virtual void BeforeGetUserInfo(BeforeAfterRequestArgs args)
 {
 }
Example #6
0
 /// <summary>
 /// Called just after obtaining response with access token from service.
 /// Allows to read extra data returned along with access token.
 /// </summary>
 protected virtual void AfterGetAccessToken(BeforeAfterRequestArgs args)
 {
 }