Method: RSpotify.authenticate
- Defined in:
- lib/rspotify/connection.rb
.authenticate(client_id, client_secret) ⇒ Object
Authenticates access to restricted data. Requires user credentials
28 29 30 31 32 33 34 |
# File 'lib/rspotify/connection.rb', line 28 def authenticate(client_id, client_secret) @client_id, @client_secret = client_id, client_secret request_body = { grant_type: 'client_credentials' } response = RestClient.post(TOKEN_URI, request_body, auth_header) @client_token = JSON.parse(response)['access_token'] true end |