API for login with Google?

100 views
Skip to first unread message

themuse10

unread,
Jan 5, 2015, 10:27:04 AM1/5/15
to 8tracks-p...@googlegroups.com
I was wondering if it's possible to login via google account into 8tracks using the login API. I have a feature request and want to see if it's possible.

Best,
themuse10 

Netto Farah

unread,
Jan 5, 2015, 1:48:30 PM1/5/15
to 8tracks-p...@googlegroups.com, ro...@8tracks.com
Hey, Themuse10

We do have an endpoint for Google+ authentication.
It is not part of our public API though. You can use it at your own risk, but we could change it at any time and your app could possibly break.

I'm not sure how you would be able to do this without having our app details to request an AuthCode, but Rory (infinitracks android developer did it).

@Rory
Can you give us a little insight here?

--
You received this message because you are subscribed to the Google Groups "8tracks public API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 8tracks-public-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rory Smith

unread,
Jan 5, 2015, 5:12:55 PM1/5/15
to 8tracks-p...@googlegroups.com, ro...@8tracks.com

Hey! Yeah, I remember doing this, though it was over a year ago now.. I’ll try and go through it step by step, the way I think I did it, using my old code as a reference where possible…

I went to http://console.developers.google.com/project and created a project for my app. This is what users will see when they let you have permission to use their account. Under “APIs & auth”->”APIs” for the project I have “Google+ API” enabled, I can’t remember if this is enabled by default.

Then under “APIs & auth”->”Consent screen” I filled out some details like the app name, image etc. That’s what your users will really see when granting permission (in fact I think you get a preview of it to the right).

Then I added my (Android) App under “APIs & auth”->”Credentials” by following the guide. Not sure what type of app you’re adding but I’m sure you can manage that bit.

Then, in my Android app I followed the normal Google+ guidelines (https://developers.google.com/+/mobile/android/sign-in) to get myself a Google+ token from the user. Basically, this token was the golden key to unlocking 8tracks. You get it by asking the user to grant permission to your “Google app” that you just configured. When they agree and accept your permissions the Google lib returns the token.

The next bit took a bit of debugging of the way 8tracks does its auth on the website but basically there’s an api endpoint that accepts an auth_token and returns an 8tracks user_token. The magic url is:

http://8tracks.com/auth/google-plus/callback.json?include=profile+auth_token&access_token=YOUR_GOOGLE_TOKEN

GETing this with the query parameter “access_token” filled with that Google+ token should return you a user_token.. IIRC

anyways, good luck… It should be something like that

To unsubscribe from this group and stop receiving emails from it, send an email to 8tracks-public-api+unsub...@googlegroups.com.

AV

unread,
Oct 10, 2015, 10:04:23 AM10/10/15
to 8tracks public API
Rory: Thanks for the helpful info. Do you know if there is a similar endpoint for FB login ? Since the 8tracks app has FB login built-in, I am assuming there is an endpoint that the app itself uses.

Thanks
AV
Reply all
Reply to author
Forward
0 new messages