Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

add username/password authentication. #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

beanieboi
Copy link
Contributor

hey!

first of all, thanks for sondcloud2000! 👍
i implemented the feature mentioned in #16 but i'm not sure what to do with it, maybe someone can take this further.

also i'm not sure how to handle the client_secret, do you have any ideas?

this is how it works:
first auth: start the app with --auth option and provide your username and password
once this is done, the access token gets refreshed every time you start the app

any feedback is welcome!
ben

first auth: start the app with --auth option and 
provide your username and password

once this is done, the access token gets refreshed
everytime you start the app
@@ -2,7 +2,10 @@
require_relative 'soundcloud2000/application'

module Soundcloud2000
CLIENT_ID = '29f8e018e1272c27bff7d510a10da2a8'
CLIENT_ID = '29f8e018e1272c27bff7d510a10da2a8'
CLIENT_SECRET = 'MY_SECRET'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For obvious reasons it is wrong to expose the client secret.

Unfortunately the soundcloud developer documentation is not clear about that.
The oauth spec offers a couple of possible flows here, all more or less inconvenient:
http://tools.ietf.org/html/draft-ietf-oauth-v2-22#section-9

Actually I think the solution is similar to the client-side flow here:
http://developers.soundcloud.com/docs#authentication

Example: https://soundcloud.com/connect?client_id=609ae0b573913db156968e0ec38c1e26&redirect_uri=http%3A%2F%2Fdevelopers.soundcloud.com%2Fcallback.html&response_type=code_and_token&scope=non-expiring&display=popup

Somehow the user has to see the connect screen, which is a login effectively.
The user-agent redirects to the given redirect url, which also contains the code and the token.
Maybe it is possible to call this endpoint directly with username/password and get back the non-expiring token.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants