"Could not match JWT signature to any of the bindings" error meaning when getting access token? | Community
Skip to main content
Level 2
June 24, 2020
Solved

"Could not match JWT signature to any of the bindings" error meaning when getting access token?

  • June 24, 2020
  • 5 replies
  • 10644 views

I have an app that uses the Privacy API to anonymise user details upon request. The app generates a JWT and sends it to https://ims-na1.adobelogin.com/ims/exchange/jwt to retrieve an access token to use for the Privacy API request. However, following the recent changes to the Adobe I/O console, my app has stopped working. In an effort to get it working again, I have created a new project in the console to use for it. Now when trying to get an access token, I am getting a 400 bad request error with the detail of "Could not match JWT signature to any of the bindings". Can anyone please tell me exactly what causes this specific error? I can't find it mentioned in the documentation.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by BenCrowe

I've found the answer myself; I was using the incorrect private key.

5 replies

BenCroweAuthorAccepted solution
Level 2
June 24, 2020

I've found the answer myself; I was using the incorrect private key.

BenCroweAuthor
Level 2
August 3, 2021
Hi JohnnyBravo, which part are you struggling with? And what language are you using?
Level 3
July 31, 2021

Hi BenCrowe, I'm trying to create an app to do the same thing; generate a JWT to get an access token. Could you do me a massive favor and share your code with me? I'm struggling to get my app to work. Much appreciated if possible! Thank you

Level 3
August 3, 2021

Hi BenCrowe, thank you very much for the reply. I'm using C# / console app, and I keep getting the same error you got "Could not match JWT signature to any of the bindings" when I try to get the access token after generating the JWT per the below and posting. I'm certain I have the right key. Below is what I have. Thanks again for any tips, much appreciated!

 

using Microsoft.IdentityModel.Tokens;
using RestSharp;
using System;

using System.IdentityModel.Tokens.Jwt;

using System.Linq;

using System.Text

string key = System.IO.File.ReadAllText(@"C:\[directory....]\private.key");

var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(key));

var credentials = new SigningCredentials
(securityKey, SecurityAlgorithms.HmacSha256Signature);

var header = new JwtHeader(credentials);

var payload = new JwtPayload
{  // payload stuff - double checked - values correct
{"exp",'....''},
{ "iss",",,,,,,"},
{"sub","......."},
{"https://.........",true},
{"aud","......."}
};

var secToken = new JwtSecurityToken(header, payload);
var handler = new JwtSecurityTokenHandler();

var tokenString = handler.WriteToken(secToken);

Console.WriteLine(tokenString);
Console.WriteLine("Consume Token");

var token = handler.ReadJwtToken(tokenString);

Console.WriteLine(token.Payload.First().Value);

BenCroweAuthor
Level 2
August 4, 2021

Hi JohnnyBravo, I'm afraid I don't know C#. The code I wrote is in PHP for a Linux-based server. All I can suggest is outputting the key data you are reading in somewhere, a debug log or something, to make sure you are reading it correctly. I would also maybe avoid applying the UTF8 coding to the key to see if that helps, it may be changing the value somehow.

Level 3
August 4, 2021
Thank you for the reply BenCrowe. I'm using C#. I'm getting the same error you mentioned you got before "Could not match JWT signature to any of the bindings" when trying to retrieve the access token. I'm sure I'm using the correct private key. How did you put the key into your code? I'm using System.IO and reading the key from a folder on C: drive. Thanks again
Level 3
August 4, 2021
Thank you BenCrowe. I really appreciate your replies and help. I'll try the tips you recommended and see if that does the trick. Thanks again, take care.
May 25, 2022

Hi JohnnyBrovo,

I am facing the same issue. Can you please help me.

tmj
Adobe Employee
Adobe Employee
May 27, 2022

Hi @mukeshpatil please feel free to post a new forum question with the exact issue details and we can probably help you out.