Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Was the end-user authentication of the Salesforce connector been deprecated? #63

Open
hoyo opened this issue Nov 3, 2024 · 8 comments
Labels
question Further information is requested

Comments

@hoyo
Copy link

hoyo commented Nov 3, 2024

I had used the Salesforce connector of deno-slack-hub with Slack Workflow​.

import { Connectors } from "deno-slack-hub/mod.ts";
 
// ...
 
MyWorkflow.addStep(
  Connectors.Salesforce.functions.CreateRecord,
  {
    salesforce_access_token: { credential_source: "END_USER" },
    salesforce_object_name: "Task",
    metadata: {
      // ...
    },
  },
);

When I ran slack deploy recently, the following error message appeared and it seems not to work.

📝 This value has been deprecated. Please update. (end_user_oauth_requires_last_interactor)

Is there any solution of this problem?

@filmaj filmaj added the question Further information is requested label Nov 4, 2024
@mwbrooks
Copy link
Member

mwbrooks commented Nov 4, 2024

@mwbrooks
Copy link
Member

mwbrooks commented Nov 4, 2024

Hey @hoyo 👋🏻 Thanks for using the Slack CLI and Deno SDK 🙂

Can you tell us whether the end_user_oauth_requires_last_interactor message is an error message or warning message?

@mwbrooks
Copy link
Member

mwbrooks commented Nov 4, 2024

Hello again @hoyo 👋🏻 I've been talking with a few backend engineers at Slack. If possible, would you mind adding user_context_source: "LAST_INTERACTOR" to your code sample to see if it removes the error/warning?

MyWorkflow.addStep(
  Connectors.Salesforce.functions.CreateRecord,
  {
    salesforce_access_token: { credential_source: "END_USER", user_context_source: "LAST_INTERACTOR" },
    salesforce_object_name: "Task",
    metadata: {
      // ...
    },
  },
);

The reasoning is that the Slack API defaults to user_context_source="CALLER_USER" for backwards compatibility, but credential_source="END_USER" requires user_context_source="LAST_INTERACTOR". If this unblocks you, then I'll bring it back to the team so that we can improve our documentation and code samples. 🙇🏻

@hoyo
Copy link
Author

hoyo commented Nov 5, 2024

Thank you for your response.

I tried your advice, and the end_user_oauth_requires_last_interactor error no longer appears

However, the workflow is not being executed, so there may be an error in another part of the code

I have implemented a workflow that includes a Salesforce connector to be triggered via the workflow button. After running slack run or slack deploy, but the workflow that includes the Connectors.Salesforce.functions.CreateRecord step is not responding. If I comment out the Connectors.Salesforce.functions.CreateRecord step, the other steps work normally.

@WilliamBergamin
Copy link
Collaborator

It appears theirs been a breaking change to the definition of Connectors.Salesforce.functions.CreateRecord on the backend 🤔

It now seems to be using a type that is not yet defined by the deno SDK, I opened up this PR to add it, reviews will soon be welcome

But this missing type caused the automated job generating the source code of deno-slack-hub to fail, I suspect this may be the underlying issue, I suspect Connectors.Salesforce.functions.CreateRecord is out of date

@WilliamBergamin
Copy link
Collaborator

@hoyo [email protected] is out and should resolve this issue 🚀

Let us know if we can close this issue!

@hoyo
Copy link
Author

hoyo commented Dec 11, 2024

@WilliamBergamin Thank you for your support.

Unfortunately, the problem was not solved when I have updated [email protected] and [email protected].

The workflow including a step with Connectors.Salesforce.functions.CreateRecord, my shortcut trigger will not respond and there is no message in log. If I commenting out the step with Connectors.Salesforce.functions.CreateRecord, it will enable it to work normally.

@WilliamBergamin
Copy link
Collaborator

WilliamBergamin commented Dec 11, 2024

I was able to reproduce this behavior, It seems this may be a backend issue related to the external authentication of the connector

I'm am trying to figure out if there is a potential work around to this this 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants