Run Actions Only Once per Session

Overview

There are some actions in the tenant which calls multiple apis, is there any way we could run these actions only once per session, and not on silent auth calls or refresh token exchanges? Doing so would help to make our actions run faster.

Applies To

  • Actions

Solution

In addition to running on a user's login to start a session, Actions will also run on Silent Authentication requests and on Refresh Token exchanges. You can however configure your actions to bypass these two other scenarios.

For Refresh token flows, you can just add the following to the beginning of each action to bypass it:
      if(event.transaction.protocol === "oauth2-refresh-token"){
            return;
      }

For silent auth flows you can just change the condition to event.request.query.response_mode === 'web_message' and it should bypass the rest of the Action logic for that action as well:
 
      if(event.request.query.response_mode === 'web_message'){
            return;
      }

 

Recommended content

No recommended content found...