Railgun JWT

JwkSetLoader

Provides an interface for loading JwkSet instances.

Table of Contents

Methods

loadJwkSet()  : JwkSet
Creates a JwkSet instance from given data.

Methods

loadJwkSet()

Creates a JwkSet instance from given data.

public loadJwkSet(string|array{keys: array}|object $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 : string|array{keys: array}|object

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

Tags
throws
InvalidArgumentException

If $jwks was a format that cannot be loaded.

throws
Throwable

If $jwks could not be loaded for other reasons.

Return values
JwkSet

        
On this page

Search results