This is intended for the users who have configured WSO2 API Manager 1.7.0 with JWT and wants to see the messages with JWT. If you haven’t configured it, please refer this
1. Enable debug logs for the following loggers in WSO2APIM_HOME/repository/conf/log4j.properties file
log4j.category.org.apache.synapse.transport.nhttp.wire=DEBUG
log4j.category.org.apache.synapse.transport=DEBUG
2. Restart the WSO2 API Manager if already started
3. Access your API and have a look at carbon logs
4. You will get something similar to the following log
[2014-11-30 22:09:22,610] DEBUG - headers http-outgoing-2 >> X-JWT-Assertion: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5tSm1PR1V4TXpabFlqTTJaRFJoTlRabFlUQTF
ZemRoWlRSaU9XRTBOV0kyTTJKbU9UYzFaQT09In0=.eyJpc3MiOiJ3c28yLm9yZy9wcm9kdWN0cy
9hbSIsImV4cCI6MTQxNzM2NjQ2MTk5OCwiaHR0cDovL3dzbzIub3JnL2NsYWltcy9zdWJzY3JpYmV
yIjoicmFqa3VtYXIiLCJodHRwOi8vd3NvMi5vcmcvY2xhaW1zL2FwcGxpY2F0aW9uaWQiOiIxIiwiaHR0
cDovL3dzbzIub3JnL2NsYWltcy9hcHBsaWNhdGlvbm5hbWUiOiJEZWZhdWx0QXBwbGljYXRpb24iLC
JodHRwOi8vd3NvMi5vcmcvY2xhaW1zL2FwcGxpY2F0aW9udGllciI6IlVubGltaXRlZCIsImh0dHA6Ly9
3c28yLm9yZy9jbGFpbXMvYXBpY29udGV4dCI6Ii9waG9uZXZlcmlmeSIsImh0dHA6Ly93c28yLm9yZy
9jbGFpbXMvdmVyc2lvbiI6IjEuMC4wIiwiaHR0cDovL3dzbzIub3JnL2NsYWltcy90aWVyIjoiVW5saW1pd
GVkIiwiaHR0cDovL3dzbzIub3JnL2NsYWltcy9rZXl0eXBlIjoiUFJPRFVDVElPTiIsImh0dHA6Ly93c28yL
m9yZy9jbGFpbXMvdXNlcnR5cGUiOiJBUFBMSUNBVElPTiIsImh0dHA6Ly93c28yLm9yZy9jbGFpbX
MvZW5kdXNlciI6InJhamt1bWFyQGNhcmJvbi5zdXBlciIsImh0dHA6Ly93c28yLm9yZy9jbGFpbXMvZ
W5kdXNlclRlbmFudElkIjoiLTEyMzQiLCAiaHR0cDovL3dzbzIub3JnL2NsYWltcy9lbWFpbGFkZHJlc3Mi
OiJyYWprdW1hcnJAd3NvMi5jb20iLCAiaHR0cDovL3dzbzIub3JnL2NsYWltcy9naXZlbm5hbWUiOiJtb2
1vIiwgImh0dHA6Ly93c28yLm9yZy9jbGFpbXMvbGFzdG5hbWUiOiJtb20iLCAiaHR0cDovL3dzbzIub3J
nL2NsYWltcy9yb2xlIjoiSW50ZXJuYWwvc3Vic2NyaWJlcixJbnRlcm5hbC9ldmVyeW9uZSJ9.eczrlpBg3
+38Y90voBIhei3wXMZqZWV5z4q4nSQoUPPlUYXAo6UGmsiwBkT17BivS16K0I69tGwpxKzju/Tg8slT
06bLVmOwIeFtMH86HLh/VPKqnZ0WKgsZw5fFxccIYDgIfnzo8Gg+x9+tL+R2i71e5EOc7098FXZOXH
nlYm0=
5. As you can see, this is the JWT token in encoded format. The above message contains three parts separated by dots. We can decode this message and see what it represents. You can go https://www.base64decode.org/ and decode this message party by part.
6. If you copy paste the first part of the message (blue) into the decoder, you will get something like below
And that contains JWT headers.
7. If you copy paste the second part of the message (pink), into the decoder, you will get something like below
And that contains JWT claims set.
8. That’s it. You have decoded and viewed the end user details that have been sent to the back end.
No comments:
Post a Comment