I want to use JWT for authentication, so I am trying to use Keycloak to get the Bearer token. My problem is that when I set the scope=openid in the request. The response contains both the access_token and id_token as blow:
{
"access_token": "eyJAlW7lLfxPta...MS85g",
"expires_in": 300,
"refresh_expires_in": 1800,
"token_type": "Bearer",
"id_token": "eyJhbGciOmQtMzJhOThS...Htm2OSGo9pVs-CWBJGaPC2Z2ib6FSSckzTxA",
"not-before-policy": 0,
"session_state": "d76a27af-3780-4843-9c6d-32a98c1f6625",
"scope": "openid"
}
As I know the access_token is for authorization that I do not need it. I just need the id_token for authentication. Is it possible to remove the access_token from the Keycloak response, or it is just a global OIDC rule that id_token always comes with access_token? And Am I using the correct token or authentication must done by access_token?