Adding lastLogin timestamp to an Access Tokens claims via expression language

Is there syntax in Okta’s EL to add a custom claim(lastLogin Timestamp) to an access token? Or is this only available via GET Request to Okta /users

I have tried the following with no success

user.lastLogin
lastLogin
{{#lastLogin}}
{{lastLogin}}
{{/lastLogin}}

Hi, Not all the user attributes can be accessed through the custom claims, lastLogin being one of them. This is only possible via the Users Endpoint as you mentioned.

To check what user attributes you can get back, make a custom claim and assign it’s value as user. Then in the Token preview you can get an idea of what values are accessible in the Tokens

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.