I’m getting an “bad authorization header” exception when trying to call the .Net RevokeAccessToken() function. I’m wondering if you can look in the sandbox logs to see what is not done correctly. The sandbox application ID is sandbox-sq0idb-5tdxJb07W00p1bceSNSPeA
Here is my code:
string AppAccessToken = ApplicationAccessToken();
string AppId = ApplicationId();
string AppSecret = ApplicationSecret();string AccessToken = null;
dynamic SquareData = JObject.Parse(g.Company.CCProcessorData);
if (SquareData != null && SquareData.AccessToken != null)
{
AccessToken = Convert.ToString(SquareData.AccessToken);
}if (AppAccessToken != null && AppId != null && AppSecret != null && AccessToken != null)
{
SquareClient SquareApi = new SquareClient.Builder()
.Environment(g.TestMode ? Square.Environment.Sandbox : Square.Environment.Production)
.AccessToken(AppAccessToken)
.Build();RevokeTokenRequest RevokeTokenReq = new RevokeTokenRequest.Builder()
.ClientId(AppId)
.AccessToken(AccessToken)
.Build();try
{
RevokeTokenResponse RevokeTokenResp = SquareApi.OAuthApi.RevokeToken(RevokeTokenReq, AppSecret);
}
catch (ApiException Ex)
{}
}
Thanks