IBM Verify

IBM Verify

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  inactive timeout and access tokens

    Posted Wed June 14, 2023 09:12 AM

    Hi,

    Do you have any design recommendation on how to solve an inactive timeout with access token.

    Let's say that you have a token that is valid for 60 minutes, but show be revoked if it has not been used for 5 minutes.

    Is this possible to solve in a mapping rule? And are there any examples on how to do it? Can you invalidate the token in a mappingrule?



    ------------------------------
    Regards Mikael
    ------------------------------


  • 2.  RE: inactive timeout and access tokens

    Posted Wed June 14, 2023 11:28 AM

    Hello Mikael,

    In the OAUTH 2.0 Framework access tokens are by design short lived tokens.

    My suggestion would be to make the access token lifetime the value of the inactivity timeout and use a refresh token. Define the refresh token timeout to be the full session timeout.

    This would accomplish 2 things.

    1) The access token is short lived and short scoped meaning that it would expire and unless the client had the refresh token they could not get another token

    2) The refresh token can only be acquired through an authenticated flow. When the refresh token lifetime expires authentication would be required again.

    Our product does have a '/revoke' endpoint.

    It's also possible to delete tokens using the 'com.tivoli.am.fim.trustserver.sts.utilities.OAuthMappingExtUtils.deleteToken​(java.lang.String tokenID)' class and method.



    ------------------------------
    JACK YARBOROUGH
    ------------------------------



  • 3.  RE: inactive timeout and access tokens

    Posted Thu June 15, 2023 01:05 AM

    Where you are using ISVA Reverse Proxy as the enforcement point, you can have the RP invalidate the Access Token when the inactivity timer fires (session ends). 


    See the OAuth 2.0 Logout endpoint. 

    A URL where you can end a session by revoking an access_token. The token must be provided in the Authorization header or a session cookie must be used.

    Setting [acnt-mgt] single-signoff-uri to this endpoint ensures that when pkmslogout is called or when the WebSEAL session times out because of inactivity, the access token is revoked.

    [acnt-mgt]
    single-signoff-uri = 
    /mga/sps/oauth/oauth20/logout

    If this functionality is not desired, the [acnt-mgt] single-signoff-uri entry must be unset.


    I've also written a bunch of stuff on this topic here. https://philipnye.com/2014/07/29/isam-for-web-and-mobile-oauth-authentication-and-sessions/
    It's a bit old, but mostly still relevant. 



    ------------------------------
    Philip Nye
    IBM
    Gold Coast
    ------------------------------



  • 4.  RE: inactive timeout and access tokens

    Posted Thu June 15, 2023 03:09 AM

    Hello Philip,

    "Where you are using ISVA Reverse Proxy as the enforcement point, you can have the RP invalidate the Access Token when the inactivity timer fires (session ends). "

    Does this mean that there is some kind of inactivity timer on the token and if so, is this based on the am_eai_xattr_inactive_timeout value?



    ------------------------------
    Regards Mikael
    ------------------------------



  • 5.  RE: inactive timeout and access tokens

    Posted Thu June 15, 2023 03:25 AM

    This part in you blog was interesting, i think this is what we are after.
     
    This means that inactivity is important to consider, such that you may have an access token valid for 60 mins, but an inactivity of 10mins. If you would like to modify this dynamically, modify the OAuth response in the Post Token mapping rule to give the desired value.

    (For example, you might set the token lifetime short in the API definition, but report a longer max lifetime value in the Post Token mapping rule to enable sessions that extend beyond life of a token based on activity.)



    ------------------------------
    Regards Mikael
    ------------------------------



  • 6.  RE: inactive timeout and access tokens

    Posted Thu June 15, 2023 03:01 AM

    Hello Jack,

    I was thinking in the same directions at first, but the issue is then that the refresh token is kind of "am_eai_xattr_session_lifetime" so while that one is active you can always get a new access token without needing to authenticate again, which you would need to do in a cookie flow.

    Thanks for pointing the 'deleteToken' api, i will try this one out.



    ------------------------------
    Regards Mikael
    ------------------------------