Google Authentication on Android and Passport / Loopback.io

441 views
Skip to first unread message

Damien Galan

unread,
Sep 11, 2014, 11:18:09 AM9/11/14
to loopb...@googlegroups.com
Hi,

I'm trying to authenticate an user from Android with the Account Manager, i'm able to retrieve a token but when i send this token to loopback (  /auth/google/callback?code=MYTOKEN  ) 
i have the error "Invalid Grant, Incorrect token type"

I'm using this sample on android https://gist.github.com/TomTasche/5665497 

Any clues ?

Thanks

Raymond Feng

unread,
Sep 11, 2014, 11:29:21 AM9/11/14
to Damien Galan, loopb...@googlegroups.com
There are two things in oAuth 2:

- access token
- authorization code

The /auth/google/callback should receive an authorization code so that it can request an access token from Google.

Can you check what you got from Android?

Thanks,

---
Raymond Feng
Co-Founder and Architect @ StrongLoop, Inc.

StrongLoop makes it easy to develop APIs in Node, plus get DevOps capabilities like monitoring, debugging and clustering.

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

Koustuv Sinha

unread,
Sep 15, 2015, 2:47:37 AM9/15/15
to LoopbackJS, damien...@gmail.com
Hi,

I have the same question. I am developing an Android application with Loopback backend api. Now loopback api exposes "/auth/google/callback?" api, and using Android Account Manager we can get the access token. But when I try to send that token to the api, i get a 500 server error : "InternalOAuthError: failed to obtain access token". Now I am new into this so please bear with me. I am following the architecture from the SO post by Damien. Ideally, when my android app gets the access token, it should send it back to Loopback API and in turn log in to the server? You said an authorization code is needed, is it another parameter of the API call?

Thanks & Regards,

Koustuv Sinha
Reply all
Reply to author
Forward
0 new messages