Skip to content

incomplete_raw_credentials is thrown on slack user_token #3561

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

Open
almeynman opened this issue Feb 22, 2025 · 6 comments
Open

incomplete_raw_credentials is thrown on slack user_token #3561

almeynman opened this issue Feb 22, 2025 · 6 comments
Labels

Comments

@almeynman
Copy link

Might be related to this one #3560

I want to obtain slack user token, not bot token

So when I trigger connection with the following code.

      const connectSession = await createConnectSession.mutateAsync({
        integrationId: selectedIntegration.id,
      });
      new Nango({
        connectSessionToken: connectSession.token,
      })
        .auth(
          selectedIntegration.id,
          selectedIntegration.provider.id === 'slack'
            ? {
                authorization_params: {
                  user_scope: // <---- supplying user scopes like this works
                    'channels:history,channels:read,channels:write,channels:write.topic,chat:write',
                },
                user_scope: [ // <---- supplying user scopes like this does not works
                  'channels:history',
                  'channels:read',
                  'channels:write',
                  'channels:write.topic',
                  'chat:write',
                ],
              }
            : {},
        )
        .then((_result) => {

In Nango Console > Logs I see the following

Image

This is the content of the failing log, with some data redacted.

{
  "rawCredentials": {
    "authed_user": {
      "access_token": "access token",
      "scope": "channels:history,groups:history,im:history,mpim:history,channels:read,groups:read,im:read,mpim:read,reactions:read,reminders:read,team:read,users:read,users:read.email,users.profile:read,channels:write,chat:write,groups:write,im:write,im:write.topic,mpim:write,mpim:write.topic,reactions:write,reminders:write,users:write,users.profile:write,channels:write.topic,groups:write.topic",
      "id": "user id",
      "token_type": "user"
    },
    "enterprise": null,
    "is_enterprise_install": false,
    "team": {
      "name": "Proxi",
      "id": "slack team id"
    },
    "ok": true,
    "app_id": "my app id"
  },
  "error": {
    "message": "An unhandled error of type 'incomplete_raw_credentials' with payload '{}' has occurred",
    "payload": {}
  }
}

I tracked the issue down to this line.

Seems like parseRawCredentials expects to find access_token at the root, but it's under authed_user, i.e. authed_user.access_token.

Copy link

linear bot commented Feb 22, 2025

Copy link
Contributor

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the Stale label Apr 17, 2025
@yksolanki9
Copy link

hi @almeynman , I'm facing the same issue. Were you able to figure it out?

@almeynman
Copy link
Author

Hi, I forked and deployed a version with a fix on my infrastructure. I created a PR, but there are some comments, that I have not addressed yet

@almeynman
Copy link
Author

This is the PR #3562

@yksolanki9
Copy link

Awesome, thanks!

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

No branches or pull requests

2 participants