Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions background/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function addOnBeforeRequestEventListener() {
} else {
chrome.webRequest.onBeforeRequest.addListener(
onBeforeRequestEvent,
{urls: ["https://signin.aws.amazon.com/saml"]},
{urls: ["https://*signin.aws.amazon.com/saml","https://*signin.amazonaws-us-gov.com/saml"]},
["requestBody"]
);
if (DebugLogs) console.log('DEBUG: onBeforeRequest Listener added');
Expand Down Expand Up @@ -150,9 +150,9 @@ function onBeforeRequestEvent(details) {
// from this argument and uses it to call the AWS STS assumeRoleWithSAML API.
function extractPrincipalPlusRoleAndAssumeRole(samlattribute, SAMLAssertion, SessionDuration) {
// Pattern for Role
var reRole = /arn:aws:iam:[^:]*:[0-9]+:role\/[^,]+/i;
var reRole = /arn:(aws|aws-us-gov):iam:[^:]*:[0-9]+:role\/[^,]+/i;
// Patern for Principal (SAML Provider)
var rePrincipal = /arn:aws:iam:[^:]*:[0-9]+:saml-provider\/[^,]+/i;
var rePrincipal = /arn:(aws|aws-us-gov):iam:[^:]*:[0-9]+:saml-provider\/[^,]+/i;
// Extraxt both regex patterns from SAMLAssertion attribute
RoleArn = samlattribute.match(reRole)[0];
PrincipalArn = samlattribute.match(rePrincipal)[0];
Expand Down