Sign-in with Google example (cURL) |
[eluser]Peng Kong[/eluser]
Code: class Account extends Controller { 1) browse to: https://localhost/codeigniter/account/signin 2) click on the link 3) sign-in on google's page 4) return to 'signin_return' page, that echos all the necessary stuff this is just a proof of concept for a auth module im working on. http://ellislab.com/forums/viewthread/144755/
[eluser]Sbioko[/eluser]
Nice work! Congratulations! I think, your auth module will be awesome!
[eluser]ocdcoder[/eluser]
Peng Kong, What version of CI are you using? I tried this with 1.7.2 (which could be upgraded) and I got an error for the anchor function. Was that added in a recent version of CI? Other than that, nice work!
[eluser]Peng Kong[/eluser]
$this->load->helper('url'); or simple change to Code: echo "<a href='".$signin_url."'>click here</a>'"; im using the latest ver of CI but this has nothing to do with that
[eluser]ocdcoder[/eluser]
haha, ok. I'm relatively new to CI, and URL hasn't been one of the helpers I've looked at so far. Thanks!
[eluser]Peng Kong[/eluser]
you should look into it... its my only auto-loaded helper for that matter lol anchor() and redirect() is just so useful
[eluser]ocdcoder[/eluser]
Just out of curiosity, why aren't you using this OpenID library, http://codeigniter.com/wiki/OpenID/ ?
[eluser]Peng Kong[/eluser]
what i've posted is more of a barebone code to help people play around with and understand the google openid protocol. the ci openid library uses the php openid library http://openidenabled.com/php-openid/ which is what im using.
[eluser]ocdcoder[/eluser]
Peng Kong, FYI, for some reason. You had ;'s in your "openid" GET pararms to the $google_endpoint (in the 2nd cURL request). This was causing an issue with my tests. Removing these ;'s resolved the issue.
|
Welcome Guest, Not a member yet? Register Sign In |