Skip to content

Commit 0450508

Browse files
committed
docs: add readme for sso credential provider
1 parent ec14a32 commit 0450508

File tree

2 files changed

+66
-6
lines changed

2 files changed

+66
-6
lines changed

packages/credential-provider-ini/README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ aws_access_key_id=foo
9090
aws_secret_access_key=bar
9191

9292
[first]
93-
source_profile=first
93+
source_profile=second
9494
role_arn=arn:aws:iam::123456789012:role/example-role-arn
9595
```
9696

@@ -125,3 +125,46 @@ credential_source = EcsContainer
125125
web_identity_token_file=/temp/token
126126
role_arn=arn:aws:iam::123456789012:role/example-role-arn
127127
```
128+
129+
You can specify using the `first` profile which will assume a role
130+
`example-role` with the role `example-role-2` which derived from web
131+
identity token file.
132+
133+
```ini
134+
[second]
135+
web_identity_token_file=/temp/token
136+
role_arn=arn:aws:iam::123456789012:role/example-role-2
137+
138+
[first]
139+
source_profile=second
140+
role_arn=arn:aws:iam::123456789012:role/example-role
141+
```
142+
143+
### profile with sso credentials
144+
145+
Please refer the the [`sso credential provider package`](https://www.npmjs.com/package/@aws-sdk/credential-provider-sso)
146+
for how to configure the SSO credentials.
147+
148+
```ini
149+
[default]
150+
sso_account_id = 012345678901
151+
sso_region = us-east-1
152+
sso_role_name = SampleRole
153+
sso_start_url = https://d-abc123.awsapps.com/start
154+
```
155+
156+
You can specify using the `first` profile which will assume a role
157+
`example-role` with the role `example-role-2` which derived from SSO
158+
credentials.
159+
160+
```ini
161+
[second]
162+
sso_account_id = 012345678901
163+
sso_region = us-east-1
164+
sso_role_name = example-role-2
165+
sso_start_url = https://d-abc123.awsapps.com/start
166+
167+
[first]
168+
source_profile=second
169+
role_arn=arn:aws:iam::123456789012:role/example-role
170+
```

packages/credential-provider-sso/README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,37 @@
66
## AWS Credential Provider for Node.js - AWS Single Sign-On (SSO)
77

88
This module provides a function, `fromSSO`, that creates
9-
`CredentialProvider` functions that read from [AWS SDKs and Tools
10-
shared configuration and credentials
11-
files](https://docs.aws.amazon.com/credref/latest/refdocs/creds-config-files.html).
12-
Profiles in the `credentials` file are given precedence over
13-
profiles in the `config` file. This provider loads the
9+
`CredentialProvider` functions that read from the
1410
_resolved_ access token from local disk then requests temporary AWS
1511
credentials. For guidance on the AWS Single Sign-On service, please
1612
refer to [AWS's Single Sign-On documentation](https://aws.amazon.com/single-sign-on/).
1713

14+
You can create the `CredentialProvider` functions using the inline SSO
15+
parameters(`ssoStartUrl`, `ssoAccountId`, `ssoRegion`, `ssoRoleName`) or load
16+
them from [AWS SDKs and Tools shared configuration and credentials files](https://docs.aws.amazon.com/credref/latest/refdocs/creds-config-files.html).
17+
Profiles in the `credentials` file are given precedence over
18+
profiles in the `config` file.
19+
20+
This credential provider is intended for use with the AWS SDK for Node.js.
21+
22+
This credential provider **ONLY** supports profiles using the SSO credential. If
23+
you have a profile that assumes a role which derived from the SSO credential,
24+
you should use the `@aws-sdk/credential-provider-ini`, or
25+
`@aws-sdk/credential-provider-node` package.
26+
1827
## Supported configuration
1928

2029
You may customize how credentials are resolved by providing an options hash to
2130
the `fromSSO` factory function. The following options are supported:
2231

32+
- `ssoStartUrl`: The URL to the AWS SSO service. Required if any of the `sso*`
33+
options(except for `ssoClient`) is provided.
34+
- `ssoAccountId`: The ID of the AWS account to use for temporary credentials.
35+
Required if any of the `sso*` options(except for `ssoClient`) is provided.
36+
- `ssoRegion`: The AWS region to use for temporary credentials. Required if any
37+
of the `sso*` options(except for `ssoClient`) is provided.
38+
- `ssoRoleName`: The name of the AWS role to assume. Required if any of the
39+
`sso*` options(except for `ssoClient`) is provided.
2340
- `profile` - The configuration profile to use. If not specified, the provider
2441
will use the value in the `AWS_PROFILE` environment variable or `default` by
2542
default.

0 commit comments

Comments
 (0)