Vapor: Is there any documentation about Facebook and Google login?

Created on 15 Mar 2018  路  31Comments  路  Source: vapor/vapor

Hey guys! Awesome work!

I was just wondering if there is any documentation about Facebook and Google login.

Any tips?

Most helpful comment

Just to add to this - there is a planned chapter on Facebook/Google authentication in the upcoming Ray Wenderlich book

All 31 comments

Maybe look at Imperial? It uses Vapor 3, so you would have to be on that version and isn't quite updated yet (I hope to get that done in ~1h). Also that documentation hasn't been updated and it only supports Google and GitHub.

If that sounds to complicated, you can look at the routes for authenticating:

And work it out from there.

I鈥檝e read something about Turnstile. Is that outdate too?

Yes. It was remove in v2, so unless your still on v1 , that's not something that can be used.

Just looking at Imperial and yes, it鈥檚 quite unfriendly for a newbie xD

How come there is no well documented guide about Facebook and Google login? Any particular reason? I鈥檓 just wondering if make sense to my company invest time on Vapor or not.

If you are asking about Vapor 2, I am not really sure. I guess it wasn't really in scope for the Vapor docs and no one in the community ever looked at creating a tutorial or anything for it.

For Vapor 3 documentation is incomplete and tutorials are more or less scarce.

Do you know when the docs for Vapor 3 about those social login will be updated?

I don't. There is a good chance that there won't be any even when the docs are complete.

I will keep working on Imperial and do my best to add support for more OAuth providers, at which point social auth will be trivial to implement.

Just to add to this - there is a planned chapter on Facebook/Google authentication in the upcoming Ray Wenderlich book

@0xTim are you referring to this? https://store.raywenderlich.com/products/server-side-swift-with-vapor

Because in base of the Proposed Table of Contents the login with social seems not to be included :)

@cikpis yeah that's the one - I can tell you it's definitely planned. Source: I'm writing it!

@0xTim Bought it already 馃憤 Do you have already an idea when it will be released? 馃

EA chapters should (will) be this month - the rest is slated for 'Spring'. It depends on when the Vapor 3 release actually hits and how much changes between now and then

Make sense, thanks!

@calebkleveter Will the auth-provider replaced in favour of Imperial? 馃

@cikpis auth-provider is no more in Vapor 3. Imperial should probably depend on the Auth package to provide a nice integration

Basically there are a lot of breaking changes from version 2 to 3 馃槄 At this point I guess I have to wait the stable release in order to start with Vapor before I will end up to waste time 馃槃

Looking forward to have the book 馃憤

@calebkleveter will the auth-provider feature be in Imperial?

I'll take a look at it once it is updated for the RC release. I am not sure how it would integrate, but there should be some places that a helper method would be nice.

That would be nice because the current auth-provider is quite good and would be pity don't have a valid alternative in Vapor 3.

Oh, I was thinking of the Auth package that Tim mentioned. I don't have any plans to support Vapor 2 in Imperial. There will be some similar helper methods to those in the Auth Provider package though.

To be clear, the current Auth package works for Vapor 3 and includes everything that Vapor 2 had in the Auth Provider. OAuth login is separate

@0xTim interesting because I couldn't make it work. I'll try again then. Which version should I use btw?

I'm using this:

// Auth
.package(url: "https://github.com/vapor/auth-provider.git", from: "1.0.0"),

// MongoDB
.package(url: "https://github.com/vapor/mongo-provider.git", from: "2.0.0"),

Are they correct for Vapor 3?

@cikpis the providers are no more in Vapor 3. So you just need:

.package(url: "https://github.com/vapor/auth.git", from: "2.0.0-rc")

Note that Mongo isn't really integrated at the moment, so if you have to use that you might need to wait. Finally, Auth in Vapor 3 has changed somewhat, I think the only up to date example is in the RW videos

I've already paid the book so I guess I'll wait xD

Thanks

BTW, @calebkleveter could you please send me a Slack invitation? I'm still waiting to receive it :)

My email is [email protected], thanks!

Looks like your already in 馃檪.
screen shot 2018-03-16 at 11 59 46 am

Ah! I was registered with a password that I have never put xD

I just reset it, thanks!

I am closing this ticket as it seem to be resolved. Facebook/Google auth is in the Imperial package. If all questions aren't answered, feel free to reopen

Just to keep the record straight, Imperial doesn't support Facebook at the moment because the maintainer (me) doesn't have a Facebook account. PRs are welcome 馃槃.

HOW CAN YOU LIVE?!?!?!

It's probably _how_ I live 馃榿.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loganwright picture loganwright  路  3Comments

Joannis picture Joannis  路  4Comments

olivier38070 picture olivier38070  路  3Comments

avario picture avario  路  3Comments

OlegKorchickiy picture OlegKorchickiy  路  3Comments