sdd / ExtAuth

A CakePHP Plugin for quick, easy federated login / external authentication (via OAuth1 and OAuth2).
18 stars 11 forks source link

Basic implementation #6

Closed si closed 9 years ago

si commented 10 years ago

The plugin looks perfect for what I'm looking at but I was wondering if you had any examples for creating a basic system with the plugin, the typical MVC stack.

It would be fantastic if you could share something, either as part of the repo or a wiki article.

Thanks.

sdd commented 10 years ago

HI Si,

I have a skeleton framework on my development machine that is up and running. I can archive the site and upload it for you if that would be helpful? I should be able to do this one I'm home from work in about 4 hours.

si commented 10 years ago

That would be fantastic, Scott. Tonight would be fine with me. I've got an app that needs authentication but I would like to use this for social integration so keen to see how you've incorporated it. Cheers!

sdd commented 10 years ago

Hi Si,

I'll send the archive of the skeleton framework to your si.jobling@gmail.com address now.

You'll need to add in valid tokens to the config/app_settings.php file, for Google / Twitter / Facebook.

Thanks,

Scott

si commented 10 years ago

Thanks Scott.

(FYI, correct email address is [removed]. Was that a (fair) typo on your part or do I need to correct something somewhere?)

sdd commented 10 years ago

Ha, no, it was a typo on my part - I managed to merge your GH username and GMail address in my head. I sent it to the correct address, but typed the wrong one here :-)

si commented 10 years ago

No problem. Received now. Thanks. Shall I look at creating an anonymous skeleton for the repository before we close the issue?

sdd commented 10 years ago

That would be fantastic, if you did - I could also then host a live version of the skeleton so people could see the plugin in action.

si commented 10 years ago

Leave it with me. I can't promise much but would like to try contribute something back to the project.

rudy1976s commented 10 years ago

Is there a way to have the skeleton? I have installed the plugin but I need some hint for starting making views and login Thanks in advance Rudy

sdd commented 10 years ago

Hi Rudy,

Sure - I'm working right now but I should be able to help you out over the next few hours.

Scotty

rudy1976s commented 10 years ago

Cool! this would be very useful I look forward to hear from you!!!! Thanks in advance!

si commented 10 years ago

I have a skeleton from @sc0ttyd if you want me to send that over?

sdd commented 10 years ago

If you could @si that would be great :-)

rudy1976s commented 10 years ago

I would like too!!!

si commented 10 years ago

Would it make sense to add the skeleton app to the repo for now? It could do with a spot of refactoring but at least it's available to everyone then.

sdd commented 10 years ago

I need to check through the code for it first in case I've left anything in there that I don't want on GH as it was from an early proto for another project. I did a brief check on it before I sent it to you, but I'd like to check more thoroughly before uploading here.

Thanks

si commented 10 years ago

Understandable. I've checked out the code to a clean repo so I can contribute back much easier. Let me know if I can help in any way.

sdd commented 10 years ago

Great, thanks. It would be good to have a working demo, preferably based on the skeleton, that we can link to in the Readme.

rudy1976s commented 10 years ago

How is the implementation? How can I negotiate credentials against facebook for example ? I would like to add a button for facebook login but user should authenticate directly on facebook site isn'it? The full workflows is a bit confusing for me!!!

rudy1976s commented 10 years ago

I have another isssue: I debugged the result of auth_callback and facebook replied that authorization code is wrong: body => '{"error":{"message":"Missing authorization code","type":"OAuthException","code":1}}' I added both secret than key in the two configurations as described in readme !

rudy1976s commented 10 years ago

I come through. It was my mistake. But I had to change a bit of the code to make it work

rudy1976s commented 10 years ago

Do you think Linkedin federation is possible ?

sdd commented 10 years ago

Not sure about LinkedIn federation - I'll see what I can find out.

rudy1976s commented 10 years ago

Hello thank you for your reply. The facebook login suddendly started working again. I have made no modification to code as well as other mods. I have also checked wheter my logins exceeded the number stated as free but the number was clearly lower that total available. I don't know what happened !

Thanks again

Rudy

PS: I have also implemented microsoft live and linkedin : it worked fine but I had to manually manage the profile information, because the system adopted by Microsoft and linkedin was different from the pattern you created.

2014-03-27 10:58 GMT+01:00 Scott Donnelly notifications@github.com:

Not sure about LinkedIn federation - I'll see what I can find out.

— Reply to this email directly or view it on GitHubhttps://github.com/sc0ttyd/ExtAuth/issues/6#issuecomment-38784995 .

Rudy

sdd commented 10 years ago

Hey Rudy,

Glad you got it working again :-)

If you have the time and are able to contribute back the MS Live and LinkedIn profiles, that would be great!

Thanks,

Scott

junyamut commented 10 years ago

Hi Scott,

Can you also send to me please? I'm interested how this works, as I am creating a simple in-house app for managing our projects. Easier to control if this app uses login via Google instead of having to create/maintain users that could come and go any time.

Or maybe a link you have shared through GDrive and the likes.

Regards, JY

sdd commented 10 years ago

Hi JY,

if you follow the instructions for installing the ExtAuth Demo, at https://github.com/sc0ttyd/ExtAuthDemo, you should be able to get some pointers as to how to integrate it into your app. You can see the demo running at http://extauth.cogentec.co.uk

naxis commented 10 years ago

Hi Scott, is there a way to get the email of the person login in? Facebook has the scope to do that. How can we add that to the plugin?

Thank you

sdd commented 10 years ago

Hi Naxis,

You need to modify Controller/Component/AuthProviders/FacebookAuthProvider.php, so that $this->AuthDialogParameters has an extra key called 'scope' representing the permissions that are required, for example:

'scope' => 'email'

You will also then need to modify normalizeProfile() as well (unless you simply extract the email from the raw response afterwards, but modifying normalizeProfile would be the recommended way.)

My preferred way would be to use a config key, Configure::read('ExtAuth.Provider.Facebook.scope'), in order to do this. I'm not working on this at present, but if you would like to contribute these changes, feel free to implement them and I'll merge them in via pull request for others to use.

Thanks,

Scott

naxis commented 10 years ago

Thank you Scott, I got the email in the case of facebook from raw. For Twitter and Google no E-mail is passed.

tuankiet2605 commented 9 years ago

Help me! When I running, auto redirect login page.

VIORENA commented 9 years ago

Hi Scott I have installed the plugin with all the instructions on CakePhp 2.5.5. I have created an empty login method inside UsersController and the login.ctp view with the buttons like this Link to Google
Link to Twitter
Link to Facebook

After that i click on the links it shows me the error: Internal Server Error Could You help me Please?

sdd commented 9 years ago

Hi VIORENA,

I'm afraid I am no longer actively maintaining this library and have no time available in which to help you, sorry.