-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
oAuth2 + PHP-auth implementation #296
Comments
I've implemented what you're talking about with google OAuth, I'm not familiar with the process of GitHub authorization, but I assume it would be similar. Here is the process I've implemented: 1 User goes to domain.tld/register Alternatively, this process can be reversed:
So when a user attempts to login with OAuth, the $_POST['credential'] value is pulled for the user's email and google unique ID, if $_POST['credential'] passes authentication, the user is logged in via $auth->login. I would assume GitHub passes similar user data. |
I too have implemented an OAuth login method allowing users to login with an associated Discord account. They must first create a local account, but once they have done that they can associate any Discord account with it to log in. Following the authentication process typical of any OAuth setup, I associate a Discord user ID with the local account data. Then, anytime a user attempts to login with Discord I run the process again. If Discord responds that the user is authenticated, I find the user by searching for the user row with the Discord ID, then log them in like this |
Well, I know how to implement oAuth2, but how to pair it with PHP-auth?
Example:
Now, how to actually "login" user via PHP-auth? Because main authorization library would be still PHP-auth. Is it possible to programatically "login" user?
The text was updated successfully, but these errors were encountered: