Is SSO login supported for PHP SDK in windows? #2578
Unanswered
jpc-bakertilly
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Hope this is this is an ok place to discuss. On my Mac, I login using SSO (aws sso login --profile ...) as that is how our org provides us access. This works great and if I set AWS_PROFILE in the environment, my PHP scripts will work just fine with only the following set (I doubt I even need region).
$client = [
'version' => 'latest',
'region' => 'us-east-1',
];
This even works if I have a Linux instance running in docker on the Mac that maps to my ~/.aws/ directory.
But I can't get this to work on Windows. I tried 3.71 and 3.246.1. AWS CLI works fine in Powershell using sso credentials. I can set $Env:AWS_PROFILE and then run any cli command (or use --profile).
But as soon as I try PHP on windows or even in the same docker image built for windows that works in the Mac, I get an out error that it can't retrieve the credentials. Basically the same error within the docker container running on Windows. This is the same code working on the Mac/Docker for Mac. Stacktrace below.
Is anyone else able to get this to work? I can't tell if it's a bug, a known limitation, or something else is required to work on Windows. Any info would be appreciated.
Slim Application Error:
Type: Aws\Exception\CredentialsException
Message: Error retrieving credentials from the instance profile metadata service. (cURL error 7: Failed to connect to 169.254.169.254 port 80: Network unreachable (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://169.254.169.254/latest/meta-data/iam/security-credentials/)
File: C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\aws\aws-sdk-php\src\Credentials\InstanceProfileProvider.php
Line: 264
Trace: #0 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\aws\aws-sdk-php\src\Credentials\InstanceProfileProvider.php(139): Aws\Credentials\InstanceProfileProvider->handleRetryableException()
#1 [internal function]: Aws\Credentials\InstanceProfileProvider->Aws\Credentials{closure}()
#2 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Coroutine.php(160): Generator->throw()
#3 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Promise.php(204): GuzzleHttp\Promise\Coroutine->_handleFailure()
#4 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Promise.php(153): GuzzleHttp\Promise\Promise::callHandler()
#5 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}()
#6 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\guzzle\src\Handler\CurlMultiHandler.php(159): GuzzleHttp\Promise\TaskQueue->run()
#7 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\guzzle\src\Handler\CurlMultiHandler.php(184): GuzzleHttp\Handler\CurlMultiHandler->tick()
#8 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Promise.php(248): GuzzleHttp\Handler\CurlMultiHandler->execute()
#9 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()
#10 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()
#11 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()
#12 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#13 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Coroutine.php(67): GuzzleHttp\Promise\Promise->wait()
#14 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Promise.php(248): GuzzleHttp\Promise\Coroutine->GuzzleHttp\Promise{closure}()
#15 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()
#16 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#17 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Coroutine.php(103): GuzzleHttp\Promise\Promise->wait()
#18 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Promise.php(274): GuzzleHttp\Promise\Coroutine->wait()
#19 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()
#20 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\guzzlehttp\promises\src\Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#21 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\aws\aws-sdk-php\src\AwsClientTrait.php(58): GuzzleHttp\Promise\Promise->wait()
#22 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\vendor\aws\aws-sdk-php\src\AwsClientTrait.php(86): Aws\AwsClient->execute()
#23 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\lib\ParamStore\ReaderByParam.php(67): Aws\AwsClient->__call()
#24 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\lib\ParamStore\ReaderByParam.php(36): Lib\ParamStore\ReaderByParam->getParametersByParam()
#25 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\lib\ParamStore\ConfigProvider.php(62): Lib\ParamStore\ReaderByParam->fromPath()
#26 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\middleware\IntegrationBoot.php(511): Lib\ParamStore\ConfigProvider->__invoke()
#27 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\middleware\IntegrationBoot.php(255): Middleware\IntegrationBoot->buildConfigAwsParam()
#28 C:\Users\jc24069\Dropbox\accttwo\customizations\a2_timesheet\public\cli.php(35): Middleware\IntegrationBoot->loadConfig()
#29 {main}
View in rendered output by enabling the "displayErrorDetails" setting.
Beta Was this translation helpful? Give feedback.
All reactions