fedyak/php-yc-iamtoken

IAM-token for a Yandex Cloud service account

1.1 2021-08-08 12:55 UTC

This package is auto-updated.

Last update: 2024-04-08 18:50:41 UTC


README

Getting an IAM token for a Yandex Cloud service account

Install

composer require fedyak/php-yc-iamtoken

Example

// Service Account ID
$service_account_id = '....';

// Service Account Key ID
$key_id             = '....';

$rsa_private_key = file_get_contents('private.pem');

$iam = new ServiceAccountIAMToken($service_account_id, $key_id, $rsa_private_key);

//$jwt = $iam->getJWT();        //JSON Web Token

$iam_token = $iam->getIAMToken();