# Post Action not working: { Salesforce + Auth0 }

**URL:** <https://community.auth0.com/t/post-action-not-working-salesforce-auth0/73331>\
**Category:** Get Help\
**Tags:** login\
**Created:** [November 17, 2021, 6:25pm UTC](https://community.auth0.com/t/post-action-not-working-salesforce-auth0/73331 "2021-11-17T18:25:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![arup.sarkar](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/arup.sarkar/32/30746_2.png) [@arup.sarkar](https://community.auth0.com/u/arup.sarkar)\
**Post date:** [November 17, 2021, 6:25pm UTC](https://community.auth0.com/t/post-action-not-working-salesforce-auth0/73331/1 "2021-11-17T18:25:23Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [November 17, 2021, 6:58pm UTC](https://community.auth0.com/t/post-action-not-working-salesforce-auth0/73331/3 "2021-11-17T18:58:25Z")

</div>

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.

> **[Understand How Auth0 Actions Work](https://auth0.com/docs/customize/actions/actions-overview)**
>
> Describes how Auth0 Actions work and what you can accomplish with them.

Hoped this helps!

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

Thank you.

---

<div class="post-metadata">

**Author:** ![arup.sarkar](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/arup.sarkar/32/30746_2.png) [@arup.sarkar](https://community.auth0.com/u/arup.sarkar)\
**Post date:** [November 17, 2021, 7:55pm UTC](https://community.auth0.com/t/post-action-not-working-salesforce-auth0/73331/4 "2021-11-17T19:55:22Z")

</div>

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 ?

 ![Screen Shot 2021-11-17 at 2.48.29 PM](https://global.discourse-cdn.com/auth0/original/3X/6/2/627deccb88a0161a84a32b4959a34c2be381d50b.png)  
 ![Screen Shot 2021-11-17 at 2.50.26 PM](https://global.discourse-cdn.com/auth0/original/3X/9/4/947b3638c4157fa492b28bb6a08e81d15b276e78.png)

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [November 19, 2021, 9:14pm UTC](https://community.auth0.com/t/post-action-not-working-salesforce-auth0/73331/5 "2021-11-19T21:14:52Z")

</div>

Hi @arup.sarkar,

Thank you for your response.

> [@arup.sarkar](#):
>
> how does this post-login action know for which application it should fire ?

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 4, 2021, 9:14pm UTC](https://community.auth0.com/t/post-action-not-working-salesforce-auth0/73331/6 "2021-12-04T21:14:57Z")

</div>

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