Note that there are some explanatory texts on larger screens.

plurals
  1. POStored Android Accounts for Authentication of Rails + Devise Accounts
    primarykey
    data
    text
    <p>Summary: I'm trying to use stored Google accounts on an Android application to authenticate users in a native application, with an API provided by a Rails 3 + Devise application, and I'm stuck.</p> <p>Details: We have an application (http://push-poll.com) which lets users gather feedback from a bunch of their friends. We've also built a native Android application. Our web app allows you to log in with your Google account, and we want to extend that functionality to the native Android app. The web app accomplishes this with Devise (for account permissions) + Omniauth (for Google account info and OAuth interaction).</p> <p>Versions: Android 2.1+, Rails 3.2.2, Devise 2.1.2, Omniauth 1.1.0</p> <p>Proposed authentication workflow:</p> <ol> <li>User hits "log in with Google account" on Android application</li> <li>User selects a stored account on Android device using AccountManager and gives permission</li> <li>Android app sends Google account token to Rails API</li> <li><strong>Rails app sends account token to Google OAuth API &lt;-- This is where I'm stuck</strong></li> <li><strong>Google returns success and account information (specifically, name + email)</strong></li> <li>Rails app find/create user by email address</li> <li>Rails app create/read/update access token from user account</li> <li>Rails access token is retuned to Android app (this is how our app currently handles api access with standard login)</li> <li>Android app includes Rails access token in all API calls</li> </ol> <p>I've scoured Google's documentation, but I am totally stuck on (4) and (5). Once I have the Google-provided email address, everything works as it does now (for either standard logins or Google/Omniauth/Devise accounts). By my best guess, this can be solved with either of the following:</p> <ul> <li>Create an API/secret key for the Android app that is shared with a web app, in order to make requests of the Google Accounts API</li> <li>Find a Google API endpoint I can simply authenticate an Android account token against and return account details</li> </ul> <p>I've been banging my head against a wall on this one for at least a week.</p> <p>FYI: I'm the web dev, and our Android dev has been kind enough to furnish me with a stubbed-out Android app that'll send an access token from Android to the API endpoint of my choosing.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload