Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(cognito_identity_credentials): Explain limitation of CognitoIden… #4455

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/credentials/cognito_identity_credentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ var STS = require('../../clients/sts');
* identity providers. See {constructor} for an example on creating a credentials
* object with proper property values.
*
* DISCLAIMER: This convinience method leverages the Enhanced (simplified) Authflow. The underlying
* implementation calls Cognito's `getId()` and `GetCredentialsForIdentity()`.
* In this flow there is no way to explicitly set a session policy, resulting in
* STS attaching the default policy and limiting the permissions of the federated role.
* To be able to explicitly set a session policy, do not use this convinience method.
* Instead, you can use the Cognito client to call `getId()`, `GetOpenIdToken()` and then use
* that token with your desired session policy to call STS's `AssumeRoleWithWebIdentity()`
* For further reading refer to: https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html
*
* ## Refreshing Credentials from Identity Service
*
* In addition to AWS credentials expiring after a given amount of time, the
Expand Down