The Rest API doesn’t allow me to use the Twitter account already on the phone to do SSO.
The use case is:
- User wants to use my Cordova app
- User wants to sign in using Twitter rather than creating an account
- User already has the Twitter app on their Android device along with a Twitter account
- User clicks “Sign in with Twitter” on my Cordova app
- App uses the Twitter account on the phone to get oauth token/secret
- App sends token/secret to server to log in user
- Server responds with user object
- App completes sign in and shows user their “Home” page
Currently, we are using the Oauth endpoint, but that means that step 5 is replaced with:
5) User types in twitter username and password even if user already has Twitter account on the phone
My goal is to not require username/password if we don’t have to.
I’ve already figured out that I can use Twitter.login to accomplish much of what I’m aiming to do; I’ve got a basic test Cordova app authenticating correctly.
My next goal is to wrap it up in a Plugin that I can import into my other projects and share with others on Github.