SoundCloud Authentication Consistently Returns 401 invalid_grant For Some Users

1k views Asked by At

I run a service that relies heavily on SoundCloud's OAuth API to perform authentication. Lately some of our users have been reporting that they're unable to log into our website through SoundCloud. Looking through our logs, I see that we're receiving a large number of 401 responses from SoundCloud, with the error message "invalid_grant".

We run node.js, and use passport-soundcloud for authentication. This error is affecting a small minority of our users, but it consistently affects the same users, to the point that they have been unable to log into our website for several weeks now.


The passport authentication call looks like:

passport.authenticate('soundcloud', {
    scope: 'non-expiring'
})(req, res, next);

This results in a URL of the form:

https://soundcloud.com/connect?response_type=code&redirect_uri=OUR_DOMAIN&scope=non-expiring&client_id=OUR_CLIENT_ID


I've so far been unable to replicate this bug with any of my own SoundCloud accounts. Things that I have tried are:

  • have users change their SoundCloud password
  • have users delete our app from their "connections" settings in SoundCloud
  • delete users' accounts from our own database

None of these have allowed the users to sign into our site through SoundCloud. I'm hoping that someone from SoundCloud can help me with this issue- I'm happy to provide more information.

0

There are 0 answers