1

I'm trying to let users sign in/up using different social account providers like ( Google, Facebook, Apple).

How can I manage to do that without using the (social plugin)?

Are there any tutorials(Module, Plugin..) to achieve such things?

The sign-in/up forms are ready and it looks like this :

enter image description here

2
  • 1
    Is there a reason you don't want to use an already established plugin? What have you tried so far? Commented Dec 5, 2021 at 20:32
  • That's because I'm still learning Craft and can't afford it right now, so I'll go with the hard way solution.
    – Ra3d K
    Commented Dec 6, 2021 at 7:25

1 Answer 1

2

At the risk of this question being closed for being too vague, maybe you need a starting point?

If you want to try your hand at writing a plugin, the first thing I would do is read up on the OAUTH protocol since that's what these services typically use to authenticate. For example, you probably want to handle this server-side so Facebook has some examples on how to do that.

Once you get a handle on that, you'd want to figure out how Craft/Yii handle authentication so you can hook into it, basically "bypassing" the built-in auth system if a user wants to login via a 3rd party provider.

There's way more too it than that and this is probably one of those use cases that sounds simple in theory but rolling your own auth solution definitely is probably not worth your time.

However it can be nice to know how these things work under the hood. (I personally don't want to be responsible for making sure it doesn't break when newer versions of Craft are released or when Facebook/Google/Apple decides to change it up.)

In that case, you can study the code of either Socializer or Social to see how they work. I would also recommend CraftQuest as a resource to learn more about Craft CMS dev.

1
  • You gave me the starting point, Thank you. I'm aware of the disadvantages of creating my own plugin, but I have no choice else but to go with it for learning purposes
    – Ra3d K
    Commented Dec 6, 2021 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.