Skip to content

Commit

Permalink
[Apple] Adding method to return SocialiteUser by JWT token (#962)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumeboussion authored Feb 11, 2023
1 parent 4452556 commit f3b9a43
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,23 @@ protected function getUserByToken($token)
return json_decode(base64_decode($claims), true);
}

/**
* Return the user given the identity token provided on the client
* side by Apple.
*
* @param string $token
*
* @throws InvalidStateException when token can't be parsed
*
* @return User $user
*/
public function userByIdentityToken(string $token): SocialiteUser
{
$array = $this->getUserByToken($token);

return $this->mapUserToObject($array);
}

/**
* Verify Apple jwt.
*
Expand Down

0 comments on commit f3b9a43

Please sign in to comment.