Loggin in users with Spotify account with the Spotify API

Beginner here, I'm trying to build an app that creates playlists for users when an address is inputted. The SongKick API fetches artists performing within X miles of that location and then feeds the artists into the Spotify API in order to create a playlist for the user.

You'd need a Spotify account in order to use this app and I figured the main page would be a Log In form for a Spotify account. I'm looking at the documentation and I'm a little confused by it.

Auth guide from Spotify's API

I'm looking at this specific example as well

From the above example, I understand how the authorization works, but correct me if I'm wrong. That only registers the user that has the client Id and credentials right? What if I want to log in any user that has a spotify account. Where do I send the params to (email and password)?


In a nutshell, your application includes Spotify's client ID and client secret key . To authorize an user, the user is redirected from your application to the third party service (Spotify), the authentication is done on their side, you are no need to process user's email and password. After user is authenticated, Spotify will redirect the user to your application, with the authorization code, that can be used to request the Spotify's API. That explains the Spotify's Authorization Code Flow.

You should understand the OAuth 2.0 Authorization (described in RFC-6749). Most third party services, such as facebook, google etc... are implemented this methodology and application can integrate them by OAuth 2.0 to authorize users.

See more: On a high level, how does OAuth 2 work?

链接地址: http://www.djcxy.com/p/9472.html

上一篇: 在Node.js中从回调函数返回一个值

下一篇: 在Spotify帐户中使用Spotify API登录用户