Class SsoTokenProvider
- Aws\Token\SsoTokenProvider implements Aws\Token\RefreshableTokenProviderInterface uses Aws\Token\ParsesIniTrait
- Namespace: Aws\Token
- Located at Token/SsoTokenProvider.php
Token that comes from the SSO provider
Methods Summary
-
__construct ( string $profileName, string|null $configFilePath = null, Aws\SSOOIDC\SSOOIDCClient $ssoOidcClient = null )
Constructs a new SsoTokenProvider object, which will fetch a token from an authenticated SSO profile
-
__invoke ( )
Loads cached sso credentials.
-
refresh ( )
This method attempt to refresh when possible. If a refresh is not possible then it just returns the current token data as it is.
-
shouldAttemptRefresh ( )
This method checks for whether a token refresh should happen. It will return true just if more than 30 seconds has happened since last refresh, and if the expiration is within a 5-minutes window from the current time.
- static getTokenLocation ( $sso_session )
- getTokenData ( $tokenLocation )
Methods Details
__construct (
string
$profileName,
string|null
$configFilePath = null,
Aws\SSOOIDC\SSOOIDCClient
$ssoOidcClient = null
)
Constructs a new SsoTokenProvider object, which will fetch a token from an authenticated SSO profile
Parameters
string | $profileName | The name of the profile that contains the sso_session key |
string|null | $configFilePath = null | Name of the config file to sso profile from |
Aws\SSOOIDC\SSOOIDCClient |
$ssoOidcClient = null | The sso client for generating a new token |
GuzzleHttp\Promise\PromiseInterface
__invoke (
)
array refresh ( )
This method attempt to refresh when possible. If a refresh is not possible then it just returns the current token data as it is.
Returns
array |
Exceptions
Aws\Exception\TokenException |
Implementation of
boolean shouldAttemptRefresh ( )
This method checks for whether a token refresh should happen. It will return true just if more than 30 seconds has happened since last refresh, and if the expiration is within a 5-minutes window from the current time.
Returns
boolean |
Implementation of
static string getTokenLocation ( $sso_session )
Parameters
$sso_session |
Returns
string |
array getTokenData ( $tokenLocation )
Parameters
$tokenLocation |
Returns
array |
Constants summary
string |
ENV_PROFILE
|
#
'AWS_PROFILE'
|
integer |
REFRESH_WINDOW_IN_SECS
|
#
300
|
integer |
REFRESH_ATTEMPT_WINDOW_IN_SECS
|
#
30
|