コード例 #1
0
ファイル: OAuth2Client.cs プロジェクト: howej/OAuth2
 /// <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)
 {
 }
コード例 #2
0
ファイル: OAuth2Client.cs プロジェクト: howej/OAuth2
 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
         });
     }
 }
コード例 #3
0
ファイル: OAuth2Client.cs プロジェクト: howej/OAuth2
 /// <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)
 {
 }
コード例 #4
0
ファイル: OAuth2Client.cs プロジェクト: jjaffe/OAuth2
 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"
     });
 }
コード例 #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)
 {
 }
コード例 #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)
 {
 }