-
Notifications
You must be signed in to change notification settings - Fork 443
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 using the new API #1036
base: master
Are you sure you want to change the base?
Google Authentication using the new API #1036
Conversation
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hello @CosminBd and thanks for your contribution PR |
@CosminBd could you resolve conflicts? |
@atymic it's good to go now |
@@ -70,7 +70,7 @@ parameters: | |||
src/Gitea: '[email protected]:SocialiteProviders/Gitea.git' | |||
src/Gitee: '[email protected]:SocialiteProviders/Gitee.git' | |||
src/Goodreads: '[email protected]:SocialiteProviders/Goodreads.git' | |||
src/Google: '[email protected]:SocialiteProviders/Google-Plus.git' | |||
src/Google: '[email protected]:SocialiteProviders/Google.git' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: need to rename this repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean remove? Google+ has become redundant, no?
$jwt = $this->request->credential; | ||
$certificates = $this->fetchCertificates(); | ||
$decoded = (array) JWT::decode($jwt, $certificates); | ||
return $this->user = $this->mapUserToObject($decoded) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line break above please
|
||
protected function getAuthUrl($state) | ||
{ | ||
// TODO: Implement getAuthUrl() method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for these comments
*/ | ||
protected function fetchCertificates(): array | ||
{ | ||
return collect(json_decode(file_get_contents('https://www.googleapis.com/oauth2/v1/certs'), true))->map(function ($key) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if getting this endpoint fails?
@CosminBd Hey man, is it possible to handle this ? |
This PR is related to #940
Using the new Google API for authentication, which moves away from OAuth and to using JWT's for identifing users.
There are still a couple of things to be fixed, mainly: