Post Action not working: { Salesforce + Auth0 }

I have created a post login action in Auth0 which is not getting invoked, I cannot see any logs to see why it is not triggering.

Context : Auth0 is the IdP, salesforce is the SP. The idea is to fire the post login action once the user signs up or logs in

I followed the post action login instructions a) connected app b) extend contact object c) got the refresh token d) created the post login action in Auth0. When I am trying login from an experience cloud and signing up, the post login action is not triggering.
Also, I need a registration handler now I can keep the code kind of empty to not do anything but I will definitely need it else it will not work. So, how does the sequencing work, post action → apex reg handler or other way around ?

Hi @arup.sarkar,

Thanks for contacting the Auth0 Community!

I understand that your Post-Login Action script has not been executing when you managed a successful authentication flow.

Given that you also did not see any logs correlating to the execution of the Action script, I believe that you may not have added the Action into your Flow.

In this case, I recommend that you do the following:

  1. Make sure that your Action script has been deployed
  2. Then make sure you have dragged and dropped your Action script into the flow interface
  3. Press Apply to save your changes

After doing so, your Action script will execute on a successful login.

Hoped this helps!

Please let me know if there’s anything else I can do to help.

Thank you.

Hi Rueben,

All the 3 points you mentioned, I believe I completed all, please see attached screenshots. I have a question, I have several applications how does this post-login action know for which application it should fire ?


1 Like

Hi @arup.sarkar,

Thank you for your response.

The Post-Login Action will execute for every application unless you specify something like the following in your script:

exports.onExecutePostLogin = async (event, api) => {
  if (event.client.client_id === 'YOUR_CLIENT_ID_HERE'){
    ...
  }
};

After looking at the screenshot of your code snippet, I would highly encourage you to make your clientId value a secret. It’s typically not a good idea to expose the client ID because it could have security implications.

Please let me know if you have any other questions, I’d be happy to help.

Thank you.

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