Search code examples
wso2wso2-identity-server

How to set last login time claim in WSO2 IS 5.11


I want to set lastLoginTime/lastLogonTime claim for the user during login. I can see possibilities to create custom authenticator or adaptive authentication script, but Im wondering if its possible to do automatically. I found this issue on WSO2IS github: https://github.com/wso2/product-is/issues/4515 where it was decoupled from idle account suspension, however I don't know how to configure it to make it work. How it should be done?


Solution

  • Add the following config to <wso2is-home>/repository/conf/deployment.toml file to enable the identityUserMetadataMgtHandler event handler.

    [identity_mgt.events.schemes.identityUserMetadataMgtHandler.properties]
    enable=true
    

    That event handler updates the last logon time of the users when they log into applications. It will update the login timestamp in http://wso2.org/claims/identity/lastLogonTime claim.

    References: