Discussions
JWT Access Token from Oauth 2.0 authentication
4 days ago by Robert M.
Hi Team,
We're running into an issue with API authorization following the guide/API reference. We're able to complete the Oauth 2.0 authorization flow in postman up to step 5, however then using the access token that is returned doesn't work.
Here's an example of the access token request that we are making in step 5 with the client id/secret redacted:
curl --request POST \
--url 'https://a.roserocket.com/oauth/token' \
--header 'content-type: application/x-www-form-urlencoded' \
--data grant_type=authorization_code \
--data 'client_id=...our client id...' \
--data 'client_secret=...our client secret...' \
--data 'code=iLy_D5quDpYc6MPrjAp5eNrwyIXaOSKfmVWegkZKPjsza' \
--data 'redirect_uri=https://oauth.pstmn.io/v1/callback'
We're getting a 200 response in postman and an access token returned from this step, however when we go to use that token in subsequent calls they return 401: "Invalid JWT token format"
An example of the access token that we are receiving and using from step 5:
eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiaXNzIjoiaHR0cHM6Ly9hLnJvc2Vyb2NrZXQuY29tLyJ9..qvByaGw8Eh6toMV9.ucM3beSM6gFgvR66UtP8xBzxfuzydg6BRC8Htb6K2L3Z2OL2TykDLMrqMd8gsP3k2UdJwhIbdK7MBX6oh6uTbBYIaApSOSdMihwteJ3kh0iZpWvQ76C0kkOihyBVhP9QpaTSXn2QpOWhgo3Z3NnKAbgx4XNm8JHgyK8SmidXR0QZvKpkkvf1dNKntZw1BLFhZklgI35FiNGIfxxtPglwk_JygXBwHBLnvpMISaugTBMfCoWOXQC6Lorr2SHInWYxYPbHOHRVlBFsAzl50M6eS7-u9hhnNB-mdDMtCLWPxuD5Hiki-ifDk85ooUsRCHU0mCF6Eu76VvYcEHgmhkYaPg7FTGawQ1uR9TBYxB5Dyd_3TWZZa2-fo2JE4FkTz4eqhYy23rWN_0Em_iLo-hck6IJVxOCGcGcVcrYSSHvH1O9nFppNMvPxX-ZY1D3WIZ751L10v8iQ8J35E4lzU16g2auvCvqRMA6dUkDMsspNjDIdUZVydfnq5rqRCx6XDJ7fO7OMeVrYtqQLJXi65S9uc40TpH3XZ3leSFfl4htryJ6qiAvadEiI50i-VjgAdwS96MY_4zlBdfZfLV0xazXF7TAZaj4aJKjlY3suWdmLPX8YJr_CtvFQj5Kzf9tXx65Oo--iEtWSfHpmdPNygV3c4roBdD1KyAmNRVNu5zNa_FL0UPBbmmm9dOiNR9bIv2b6Ef3k_OL1eok7rnVKzhPT580HolijFIQvc5aylFSbtshIPGb_uV9OV4kmwTpaJ60VFa070huURiA_Fs4APQ3keeAybQpqNi-uQOE05BnYCs4GxCIxjUrcP2-HA-sfd3stMZmuquwhOtAmYJ86_4WQ4gt9-tLaS7f15ww8UU3wPkxiadpkrPxu0tJPDpz-Js28byQvWoDbYL3ufQyBjETWn68Y4ZuR1IZumyAx7W8tgtxFh9TtdKY7ho6si6D3ufbY0TlhJOvntuOVV0P_P56l19PD6ittNbH5YmjAubGnPz1qyyDvXRL03EyckG3ac7etowOt2Gc9d0h6CxrjbEXsEguD9MZpSU-lkuijv9gC3BDLzC97dZxw0plhD2-z6roTBwjgnabX1h4LwEO9h00ZWAbrALOL5fKHB1DmmaUO7EJEUtUJsA_RgbAn29amKrBH3E9_gJzHD9_NR6YGPzVwIrJfbwhbwu1nSbNV6zbVrR_TnfU.pTgrA6BXgkAEJ5t8wKZNFg
Please let me know if there is other information needed to help troubleshoot this.
Thanks,
Robert