We have suddenly started getting below error
while decoding
JWT generated by AWS Cognito.
Spring Security JWT
{
"error": "access_denied",
"error_description": "Invalid token does not contain resource id (oauth2-resource)"
}
We re using Spring boot version : 2.0.3.RELEASE
This is more specific to tokens generated by AWS Cognito.And why it stopped working all of sudden with no changes in code base/spring lib or infra
Latest update : Seems AWS has reverted thr change(addition of 'aud claim) below decoded JWT tells the story
Todays(16 Oct 2019) JWT
{
"sub": "XXXXXXXXXXXX-6a8dd388a720",
"token_use": "access",
"scope": "XXXXXXXXXXXX",
"auth_time": 1571227222,
"iss": "YYYYYYYYYYYYYYYY",
"exp": 1571230822,
"iat": 1571227222,
"version": 2,
"jti": "XXXXXXXXXXXXXYYYYYYYYYYYYY",
"client_id": "someclient_id",
"username": "someusername"
}
Yesterday we were getting :
{
"sub": "xxxxxxxxxxxxx",
**"aud": "sameasclientid",**
"token_use": "access",
"scope": "somescope",
"auth_time": 1571132619,
"iss": "rrrrrrrrrrrrrrrrrrrrr",
"exp": 1571136219,
"iat": 1571132619,
"version": 2,
"jti": "xxxxxxxxxxxxxxxxx",
"client_id": "sameasclientid",
"username": "someusername"
}