diff --git a/Provider.php b/Provider.php index 625ea8a..7a78ac5 100644 --- a/Provider.php +++ b/Provider.php @@ -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. *