コード例 #1
0
 /// <summary>
 /// Called just after obtaining response with access token from service.
 /// Allows to read extra data returned along with access token.
 /// </summary>
 /// <param name="args">The request/response arguments</param>
 protected virtual void AfterGetAccessToken(BeforeAfterRequestArgs args)
 {
 }
コード例 #2
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>
 /// <param name="args">The request/response arguments</param>
 protected virtual void BeforeGetUserInfo(BeforeAfterRequestArgs args)
 {
 }
コード例 #3
0
 /// <summary>
 /// Called just before building the request URI when everything is ready.
 /// Allows to add extra parameters to request or do any other needed preparations.
 /// </summary>
 /// <param name="args">The request/response arguments</param>
 /// <returns>The task this handler is processed on</returns>
 protected virtual async Task BeforeGetLoginLinkUri(BeforeAfterRequestArgs args)
 {
     await Task.Factory.StartNew(() => { });
 }
コード例 #4
0
 /// <summary>
 /// Called before the request to get the access token
 /// </summary>
 /// <param name="args">The request/response arguments</param>
 protected virtual void BeforeGetAccessToken(BeforeAfterRequestArgs args)
 {
     args.Request.AddObject(
         new
         {
             client_id = Configuration.ClientId,
             client_secret = Configuration.ClientSecret,
             grant_type = GrantType
         });
     if (GrantType == _grantTypeRefreshTokenKey)
     {
         args.Request.AddObject(
             new
             {
                 refresh_token = args.Parameters.GetOrThrowUnexpectedResponse(_refreshTokenKey),
             });
     }
     else
     {
         args.Request.AddObject(
             new
             {
                 code = args.Parameters.GetOrThrowUnexpectedResponse("code"),
                 redirect_uri = Configuration.RedirectUri,
             });
     }
 }
コード例 #5
0
 protected override void BeforeGetUserInfo(BeforeAfterRequestArgs args)
 {
     args.Request.Parameters.Add(new Parameter { Name = "access_token", Value = AccessToken, Type = ParameterType.GetOrPost });
     base.BeforeGetUserInfo(args);
 }
コード例 #6
0
 /// <summary>
 /// Called just before building the request URI when everything is ready.
 ///             Allows to add extra parameters to request or do any other needed preparations.
 /// </summary>
 /// <param name="args">The argument containing the request to modify</param>
 /// <returns>The task used to execute the function to modify the request</returns>
 protected override async Task BeforeGetLoginLinkUri(BeforeAfterRequestArgs args)
 {
     await base.BeforeGetLoginLinkUri(args);
     args.Request.AddParameter("approval_prompt", "force");
 }
コード例 #7
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>
 /// <param name="args">The request/response arguments</param>
 protected virtual void BeforeGetUserInfo(BeforeAfterRequestArgs args)
 {
 }
コード例 #8
0
 /// <summary>
 /// Called just after obtaining response with access token from service.
 /// Allows to read extra data returned along with access token.
 /// </summary>
 /// <param name="args">The request/response arguments</param>
 protected virtual void AfterGetAccessToken(BeforeAfterRequestArgs args)
 {
 }
コード例 #9
0
 /// <summary>
 /// Called just before building the request URI when everything is ready.
 /// Allows to add extra parameters to request or do any other needed preparations.
 /// </summary>
 /// <param name="args">The request/response arguments</param>
 /// <returns>The task this handler is processed on</returns>
 protected virtual async Task BeforeGetLoginLinkUri(BeforeAfterRequestArgs args)
 {
     await Task.Factory.StartNew(() => { });
 }