Saturday, 15 August 2015

angularjs - Twitter oAuth in my RESTful API -



angularjs - Twitter oAuth in my RESTful API -

i have angular js front end end app separately deployed @ http://localhost:9002 , play scala end deployed @ http://localhost:9000

i want expose restful url backend http://localhost:9000/authenticate/twitter redirects user twitter oauth app asking them login twitter details.

i want redirect angular front end end app , able phone call other backend rest urls have secured twitter auth login.

i wondering how 'redirect' user twitter auth login page without losing current angular state. i.e. in pop-up , if so, how? , how homecoming oauth login , store user session info in backend well?

the best thing me pass twitter login details backend , have backend phone call twitter auth stuff , store user session there, give front end end token can utilize each auth request, whole redirect twitter login page ruins this. ideas how implement want?

this doable i've done before (sorry no illustration - commercial code) assume can open twitter in popup won't write code it

main window js window.dasecretbirdy = function (token) { //do token } popup

open twitter auth page, set redirection custom page on custom page twitter token query string , call

js window.opener.dasecretbirdy(hereismytoken)

that's concept working, maintain in mind need angularjs $apply if want assign variable on scope external code

angularjs rest twitter oauth

No comments:

Post a Comment