I'm developing a webapp with AngularJS as my framework and I want to implement OpenID for login, specifically with Google.
I was using the LightOpenID library for PHP and that seemed simple enough, but I'm struggling as to how to incorporate that into my app since it depends on the page redirecting to Google. I've considered three ways to approach this:
- A
login.php
at my base directory that users have to pass through - A partial that iframes
login.php
login.php
opening in a popup like http://openid-demo.appspot.com/
For the root solution (1), how do I go about passing state to the app?
The iframe solution (2) errors out on redirect IFRAME: Refused to display document because display forbidden by X-Frame-Options
, which I suspect has to do with security on Google's end.
The popup solution (3) doesn't seem too great, as users have popup blockers, and popups on mobile aren't too satisfactory either.
Does anyone have any idea as to how I can work within the AngularJS framework/use JavaScript to sign users in with OpenID?