Search code examples
adfswindows-server-2016

ADFS unable to verify signature of JWT


I have setup an ADFS server(windows server 2016) in VirtualBox and based on this Microsoft Flows, I am trying to get information for the logged in user. I had used both Implicit Flow and Authorization code grant Flow but in both cases I am getting the 'id_token' which I cannot verify the JWT signature. To find the public key I follow the procedure from this link. But the verification of signature failed on this jwt.io Make the call from the browser and postman.


Solution

  • I found the solution, my mistake has that in "adfs/discovery/keys" url the value of "x5c" in field the has the certificate and not the public key(I thought it was). To verify the jwt token I get the certificate and extract the public key, then I make the signature verification.