superlogin icon indicating copy to clipboard operation
superlogin copied to clipboard

Various Slack providers dont work

Open natew opened this issue 7 years ago • 2 comments

Tried getting all of the following working, patching them as I could along the way: 1 2 and 3.

Problem seems consistent, when superlogin runs:

  // API token strategy
  passport.use(new BearerStrategy(
    function (tokenPass, done) {
      var parse = tokenPass.split(':');

tokenPass throws an error at split, because tokenPass comes in as:

[ 'token:here', '' ]

If I patch that line just to check for array and properly get it, you then get to the userProfile callback, but accessToken is undefined.

Would be willing to pay some for help here, this is something I'd love to get working in the next few days and going through superlogin would be helpful.

natew avatar Aug 01 '17 19:08 natew

Looking into this more, after adding logging in a few areas. I'm attempting to "link" a new service to an old account.

Error happens in passport-oauth2 package:

It's attempting to do this in the OAuth2 strategy, when it calls tokenParams:

{
 redirect_uri: 'http://api.jot.dev/auth/link/slack/callback?state=bpYU_8YOSUi-nx2EWtRgZw%3AVqmx77L-QIOyQFCqtWuAQA%2C'
}

So it tries to use url /auth/link/slack/callback which then after calling self._oauth2.getOAuthAccessToken returns with { ok: false, error: 'bad_redirect_uri' }. But err is undefined, so it tries to continue and never logs out that error.

Edit: using fake slack team/creds so paste here is fine.

natew avatar Aug 01 '17 20:08 natew

Seems like issue is with having a different redirect_uri at some point in OAuth2. Slack doesn't seem to want it to change from initial one:

bad_redirect_uri | Value passed for redirect_uri did not match the redirect_uri in the original request.

natew avatar Aug 01 '17 20:08 natew