0

Is it possible to know how much is the time limit of a access token for a connected Org. As till the extent I know it is equal to your activity on connected app or timelimit set in Setup -> Administration Setup -> Security Controls -> Session Settings > Timeout value.

As if its the same is there any possibility to forcefully expire a token after sometime with the help of salesforce setting or some paramter that can be added.

1 Answer 1

3

1. Is it possible to know how much is the time limit of a access token for a connected Org

Answer is No except you hit salesforce endpoint using access token and if you get 4xx as response it means token got expired and you can call refresh token to get new token.

2. Forcefully expire token

To revoke OAuth 2.0 tokens (access/refresh), use the revocation endpoint.

https://login.salesforce.com/services/oauth2/revoke

Construct a POST request that includes the following parameters using the application/x-www-form-urlencoded format in the HTTP request entity-body. For example:

    POST /revoke HTTP/1.1
    Host: https://login.salesforce.com/services/oauth2/revoke 
    Content-Type: application/x-www-form-urlencoded

    token=currenttoken

If an access token is included, Salesforce invalidates it and revokes the token. If a refresh token is included, Salesforce revokes it and any associated access tokens.

You can also invoke using GET request with parameter token

https://login.salesforce.com/services/oauth2/revoke?token=currenttokenID

Documented here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .