Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Authentication #2

Open
ribeiropaulor opened this issue Aug 26, 2010 · 9 comments
Open

Google Authentication #2

ribeiropaulor opened this issue Aug 26, 2010 · 9 comments

Comments

@ribeiropaulor
Copy link

Hello,

I'm trying to use the plugin to give the users of my site the possibility to login with their gmail account. I've succeed to register the application and the site can log the user in. However, each time the user comes back, a new user is created.

How can I associate the same returning user with his account? How can I get his e-mail and save to sfGuardUser?

Could you please make an example available?

PS: I've read the introduction available at OpenID site. I'm familiar with those concepts now.

Regards,
Paulo

@ribeiropaulor
Copy link
Author

Hi,

I think I was wrong. Reading your code again I assume that the plugin is just for using OAuth API's. In order to login we have to implements OpenID+OAuth. Is that right? From what I've observed, sfMelodyPlugin does not implement the latter.

Regards,
Paulo

@chok
Copy link
Owner

chok commented Aug 26, 2010

Hi,

You're right the plugin don't implements OpenId+Oauth, just OAuth. It's my personnal opinion but I think OpenId is note very necessary.

Because with openid you have to take the id of the user with OAuth nothing is required you just ask authorization data.

For me OpenId is just a way to have the basics information which could be retrieve by OAuth and I make the choice to don't make the implementation of that.

In fact, sfMelody allow to manage users but in a bad way at the moment. And not for google because the method getIdentifier() of sfGoogleMelody isn't implemented yet.

You can implemented it to retrieve some informations to create the user. B

I have definitely need to work on that to make easier connection and creation of account.

If you can't waiting just implements getIdentifier() to create an user with the username you want.

Thanks for your feedbacks,
Don't hesitate if needed,

Maxime

@gimler
Copy link

gimler commented Aug 27, 2010

i have the same problem and i work on it at the moment to fix this.

plan:
with this scope https://www.googleapis.com/auth/userinfo#email you can get the email address from the user and then use retrieveByUsernameOrEmailAddress to get the user from the database. for facebook you can get it via scope email.

@ribeiropaulor
Copy link
Author

Hi Maxime,

You're right. OpenID is not necessary. However don't you think if you need only signing in capabilities, OpenID is way faster than OAuth? I mean, couldn't the library evolve to support both approaches?

I seems interesting having both implementation working together.

Anyway, you've done a great job!

Regards,
Paulo

@chok
Copy link
Owner

chok commented Sep 4, 2010

Hi,

For the problem authentification, You can check the new user creation system. I love it :)

If you have some recommendations to improve it don't hesitate.

@ribeiropaulor You're right too. OAuth has a problem because it's its primary aim after all. Its problem is you have to request a token you already have in your database because OAuth is not thinked to do that and I think this plugins need have both implementation.

So why not in a next version :)

@fain182
Copy link

fain182 commented Mar 9, 2011

there are some news about it?
I would create the user with google, but I'm not so confident with this code to "just implements getIdentifier() to create an user with the username you want.".. There is someone that already implemented it?

(this plugin anyway it's great.. thank you!)

@fain182
Copy link

fain182 commented Mar 10, 2011

I noticed that users are created without problem, and only once for account.
The only problem is that google ask me for authorization everytime instead of log me in, what should I change for solving these? I can do it without recurring to OpenID?

@mayeco
Copy link

mayeco commented Jul 26, 2011

@ribeiropaulor you can use this https://github.com/mayeco/sfOpenIdOAuth is a sandbox app for using openid+oauth with sfMelodyPlugin and sfPHPOpenIdPlugin, let me know if works for you.

@ribeiropaulor
Copy link
Author

Nice! I'll give it a try as soon as I have time. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants