/// <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) { }
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 }); } }
/// <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) { }
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" }); }