Describe the bug
While creating the SAML federation principal as below, the SAML attribute is hardcoded with https://signin.aws.amazon.com/saml or https://signin.amazonaws.cn/saml , which breaks in GovCloud, Iso and Iso-b partitions.
Expected Behavior
The construct SamlConsolePrincipal should check partition and supply the right URL.
Current Behavior
Only works in aws or aws-cn partition rest of the partition has to be changed.
Reproduction Steps
Use partition as aws-us-gov and the signon URL is https://signin.aws.amazon.com/saml
Possible Solution
Make a map from partition and push it in
llet samlSignOnUrl: string;
const partition = cdk.Aws.PARTITION;
if (partition === 'aws-cn') {
samlSignOnUrl = 'https://signin.amazonaws.cn/saml';
} else if (partition === 'aws-us-gov') {
samlSignOnUrl = 'https://signin.amazonaws-us-gov.com/saml';
} else if (partition === 'aws-iso-b') {
samlSignOnUrl = 'https://signin.sc2shome.sgov.gov/saml';
} else if (partition === 'aws-iso') {
samlSignOnUrl = 'https://signin.c2shome.ic.gov/saml';
} else {
samlSignOnUrl = 'https://signin.aws.amazon.com/saml';
}
export class SamlConsolePrincipal extends SamlPrincipal {
constructor(samlProvider: ISamlProvider, conditions: Conditions = {}) {
super(samlProvider, {
...conditions,
StringEquals: {
'SAML:aud': samlSignOnUrl,
},
});
}
...
or add saml signonUrl in fact-table and source it in SamlConsolePrincipal
Additional Information/Context
No response
CDK CLI Version
2.79.1
Framework Version
No response
Node.js Version
16
OS
macOS 12.6.5
Language
Typescript
Language Version
No response
Other information
Related issue: #22091
Describe the bug
While creating the SAML federation principal as below, the SAML attribute is hardcoded with
https://signin.aws.amazon.com/samlorhttps://signin.amazonaws.cn/saml, which breaks in GovCloud, Iso and Iso-b partitions.Expected Behavior
The construct SamlConsolePrincipal should check partition and supply the right URL.
Current Behavior
Only works in aws or aws-cn partition rest of the partition has to be changed.
Reproduction Steps
Use partition as
aws-us-govand the signon URL ishttps://signin.aws.amazon.com/samlPossible Solution
Make a map from partition and push it in
or add saml signonUrl in fact-table and source it in
SamlConsolePrincipalAdditional Information/Context
No response
CDK CLI Version
2.79.1
Framework Version
No response
Node.js Version
16
OS
macOS 12.6.5
Language
Typescript
Language Version
No response
Other information
Related issue: #22091