Railgun JWT

HttpJwkSetLoader
in package
implements JwkSetLoader

Provides a loader for JSON Web Keys.

Table of Contents

Interfaces

JwkSetLoader
Provides an interface for loading JwkSet instances.

Methods

__construct()  : mixed
instance()  : HttpJwkSetLoader
Gets a global instance of HttpJwkSetLoader with the PHPSecLib Crypto and Guzzle HTTP backends.
loadJwkSet()  : JwkSet
Creates a JwkSet instance from given data.

Methods

__construct()

public __construct(JwkSetLoader $loader, ClientInterface $httpClient, RequestFactoryInterface $requestFactory) : mixed
Parameters
$loader : JwkSetLoader

An underlying JwkSetLoader instance. May not be a HttpJwkSetLoader itself.

$httpClient : ClientInterface

PSR-18 HTTP Client implementation.

$requestFactory : RequestFactoryInterface

PSR-17 HTTP Request Factory implementation.

Tags
throws
InvalidArgumentException

If $loader is set to an instance of HttpJwkSetLoader.

loadJwkSet()

Creates a JwkSet instance from given data.

public loadJwkSet(mixed $jwks) : JwkSet

The following are all valid ways to call this method:

  • Relative path: loadJwkSet('jwks.json');
  • Absolute path: loadJwkSet('/absolute/path/to/jwks.json');
  • File URL: loadJwkSet('file:///path/to/jwks.json');
  • HTTP URL: loadJwkSet('https://railgun.sh/openid/jwks.json');
  • Encoded JSON Object: loadJwkSet('{"keys": [...]}');
  • PHP Associative array: loadJwkSet(['keys' => [...]]);
  • PHP Object: loadJwkSet(new class { public $keys = [...]; });
Parameters
$jwks : mixed

JWKs to decode. May be a path, any URL format the underlying implementation may understand, encoded JSON object or PHP object/associative array.

Return values
JwkSet

        
On this page

Search results