I follow documentation here: https://fusionauth.io/docs/v1/tech/apis/jwt
And try to get issued new JWT to gain access to second application in same tenant. I use httpie instead of curl to get access token:
source config.sh
ACCESS_TOKEN=`http POST "${URL}/api/login" \
"Authorization:${API_KEY}" \
"X-FusionAuth-TenantId:${TENANT1_ID}" \
"applicationId=${APP1_ID}" \
"loginId=${USER}" \
"password=${PASS}" \
| python -m json.tool | grep token | cut -f4 -d'"'`
echo ${ACCESS_TOKEN}
and then I use this access token in following request to get access to second application:
source config.sh
JWT=`bash access_token.sh`
http GET ${URL}/api/jwt/issue \
"Authorization: JWT ${JWT}" \
"Cookie: access_token=${JWT}" \
"applicationId=${APP2_ID}"
#http GET ${URL}/api/user \
# "Authorization: JWT ${JWT}"
Notice that commented request to /api/user works well, however request to /api/jwt/issue returns 401.
How can I fix this error?