Apple아이디로 로그인 구현하기 - PHP 라이브러리 > 365ok IT뉴스

365ok IT뉴스

Apple아이디로 로그인 구현하기 - PHP 라이브러리 정보

Apple아이디로 로그인 구현하기 - PHP 라이브러리

본문

Apple IdentityToken을 확인 및 검증하고 Apple ID로 사용자를 인증하는 PHP 라이브러리.

 

https://github.com/AzimoLabs/apple-sign-in-php-sdk

 


$appleJwtFetchingService = new Auth\Service\AppleJwtFetchingService(
            new Auth\Jwt\JwtParser(new \Lcobucci\JWT\Token\Parser(new \Lcobucci\JWT\Encoding\JoseEncoder())),
            new Auth\Jwt\JwtVerifier(
                new Api\AppleApiClient(
                    new GuzzleHttp\Client(
                        [
                            'base_uri'        => 'https://appleid.apple.com',
                            'timeout'         => 5,
                            'connect_timeout' => 5,
                        ]
                    ),
                    new Api\Factory\ResponseFactory()
                ),
                new \Lcobucci\JWT\Validation\Validator(),
                new \Lcobucci\JWT\Signer\Rsa\Sha256()
            ),
            new Auth\Jwt\JwtValidator(
                new \Lcobucci\JWT\Validation\Validator(),
                [
                    new \Lcobucci\JWT\Validation\Constraint\IssuedBy('https://appleid.apple.com'),
                    new \Lcobucci\JWT\Validation\Constraint\PermittedFor('com.c.azimo.stage'),
                ]
            ),
            new Auth\Factory\AppleJwtStructFactory()
        );

$appleJwtFetchingService->getJwtPayload('your.identity.token');

 

 

웹학교 무료강좌 / 웹학교 컨텐츠몰 / PHP포탈

By 웹학교

추천
0
  • 복사

댓글 0개

© SIRSOFT
현재 페이지 제일 처음으로