black-bits / laravel-cognito-auth

MIT License
89 stars 51 forks source link

Conditionally pass credentials so that CredentialProvider is used as a fallback #33

Closed ryzr closed 4 years ago

ryzr commented 4 years ago

Motivation: I use instance profile credentials for all of my Laravel -> AWS stuff. Currently, it's not possible to do that using this package, as it passes the key/secret credentials no matter what (even if blank)

Following the same convention as the Laravel Filesystem Manager, I've opted to conditionally append credentials to the config passed to the Cognito Client. https://github.com/illuminate/filesystem/blob/master/FilesystemManager.php#L222-L231

The AWS SDK is kinda hard to follow here, but basically: