Festify / cordova-spotify-oauth

🔐 Easy Spotify authentication for Cordova / PhoneGap apps
MIT License
16 stars 18 forks source link

No Open Intent to Login on Spotify #29

Open vitorgja opened 4 years ago

vitorgja commented 4 years ago

No open Intend to Login on Spotify, i writed code below:

const config = {
      refreshSafetyMargin: 60,
      clientId: '<<MY CLIENT ID>>',
      redirectUrl: 'myapp://callback',
      scopes: ['streaming', 'playlist-read-private', 'user-read-email', 'user-read-private'],
      tokenExchangeUrl: 'https://myapp.herokuapp.com/exchange',
      tokenRefreshUrl: 'https://myapp.herokuapp.com/refresh',
};
cordova.plugins.spotifyAuth.authorize(config)

the method authorize return the error "auth_failed" on subscribe.

already checked clientId, CLIENT_ID, CLIENT_SECRET and CLIENT_CALLBACK_URL

duffdean commented 4 years ago

Getting the same issue here too. Works fine on iOS but doesn't load Spotify login screen on Android.

Console error: auth_failed: Received authentication response of invalid type error at file:///android_asset/www/plugins/cordova-spotify-oauth/www/build/spotify-oauth.min.js:2:5374

Was able to resolve issue by referring to comments made in this issue - Works in emulator, fails on real device #10 The reason why the LoginActivity fails is because Spofity rejected the request as no SHA1 fingerprint for the app existed.

Go to your Spotify developer console and add the Android Package Name and SHA1 Fingerprint (one for development, one for production)