Soundcloud as an Oauth provider: how to connect it only once

I am currently implementing an Oauth service that will use Soundcloud as my Oauth service provider. But I have the following problem: Taking the example of Facebook or Twitter, you go in there, you enter, you fill out the permission form, and you are redirected back to your application. If you go there a second time, and if you are already logging in, you basically skip all the steps and are immediately redirected. This means that Facebook has recognized that you have already authorized this third-party service, so it does not constantly ask for your permission.

And what happens when I use Soundcloud. Basically, every time I redirect the user to the Soundcloud Oauth connection endpoint, the permission form is always displayed, even though I have previously allowed this third party service. I have to hit "connect" every time, which is a drag and drop from the user's point of view (how many times can you give permission to the same object). My question is, is there an option that I can use to force soundcloud to recognize / check the user's previous permission for this third party service? Or is it a Soundcloud Oauth design implementation that we have to live with?

Edit:

It might have been unclear, but every time I hit "connect" in soundcloud a new access token is generated and delivered. Since my application uses this access token to identify its users, it is not very good for me that the access token is refreshed every time I want to log in, which makes me effectively "register" every time. To summarize, I want to retrieve my account's previously assigned token, so I can search in my database, identify it, and enter it.

I'm also looking for a solution that doesn't involve persisting state in the client, which can be cleaned up.

+3


source to share


1 answer


What you can do is save the user's token in local storage and reuse it in future sessions. What's going on at soundcloud.com.

More detailed explanation:

When you use Stream Connect, the user is authenticated by SoundCloud (using username / password, Facebook Connect, or a pre-existing session at soundcloud.com), and then, when successful, your app will oauth token for that user. This is passed to the callback page that is registered for your application.



This token is the only information required to log a user into the system. If the token does not expire (by timing or manually canceling it manually), you can reuse it in future sessions.

I think I am a little confused about your application design: where and how is the oauth token used? I think that instead of using a token as an id, perhaps a user permalink could be better? If you have an oauth token, you can find out the permalink by requesting api.soundcloud.com/me

.

+2


source







All Articles