"auth_time" claim in the tokens is always zero for Direct Grant
Issue
When I tried to use the auth_time
claim in the access token or ID token to show the login time, I found it is always zero for Direct Grant (Resource Owner Password Grant).
{
"exp": 1669711332,
"iat": 1669711032,
"auth_time": 0,
"jti": "be484cb1-a918-4343-8a30-eafb4975bcf0",
"iss": "https://auth.example.com/auth/realms/demo",
"aud": "demo-client",
"sub": "0c7c9d63-d938-4561-b5a1-9d102896bfbb",
"typ": "ID",
"azp": "demo-client",
"session_state": "1e7c611d-4b8b-4ffb-a00d-511ee9a4c535",
"acr": "1",
"sid": "1e7c611d-4b8b-4ffb-a00d-511ee9a4c535",
"email_verified": false,
"preferred_username": "john@example.com"
}
How can I retrieve the login time from the RH-SSO server?
Environment
- Red Hat Single Sign-On (RH-SSO)
- 7.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.