wilkques/pkce-php

PKCE for PHP

v2.0.0 2022-05-18 02:56 UTC

This package is auto-updated.

Last update: 2024-11-22 11:33:32 UTC


README

Latest Stable Version License

composer require wilkques/pkce-php

How to use

use Wilkques\PKCE\Generator;

$codeVerifier = Generator::codeVerifier();

$codeChallenge = Generator::codeChallenge($codeVerifier);

// or

$pkce = Generator::generate();

$codeVerifier = $pkce->getCodeVerifier();

$codeChallenge = $pkce->getCodeChallenge();

// or

$codeVerifier = $pkce->codeVerifier;

$codeChallenge = $pkce->codeChallenge;

// or

$pkce->toArray(); // output ['codeVerifier' => '123', 'codeChallenge' => '456']

$pkce->toJson(); // output {'codeVerifier' : '123', 'codeChallenge' : '456'}

REFERENCE

  1. PKCE実装で使うcode_verifierとcode_challengeをPHPで実装する。
  2. PKCE support for LINE Login
  3. OAuth2.0拡張仕様のPKCE実装紹介 〜 Yahoo! ID連携に導入しました