private-packagist/oidc-identities

Create OIDC tokens on different platforms

dev-main 2025-07-22 10:03 UTC

This package is auto-updated.

Last update: 2025-07-22 10:10:13 UTC


README

GitHub Action to publish artifacts as package versions to Private Packagist.

Requirements

PHP >= 7.2

Install

Via Composer:

$ composer require private-packagist/oidc-identities

Usage

Initiate a TokenGenerator instance and call the generate method with $audience. The TokenGenerator will automatically try all supported platforms.

// Configure a HttpMethodsClient instance
$oidcHttpClient = new HttpMethodsClient(
    Psr18ClientDiscovery::find(),
    Psr17FactoryDiscovery::findRequestFactory(),
    Psr17FactoryDiscovery::findStreamFactory(),
);

$tokenGenerator = new TokenGenerator(new NullLogger(), $oidcHttpClient);
$token = $tokenGenerator->generate($audience);

Copyright and License

The GitHub Action is licensed under the MIT License.