Versent / saml2aws

CLI tool which enables you to login and retrieve AWS temporary credentials using a SAML IDP

Home Page:https://github.com/Versent/saml2aws

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auth0 Bug Fix - SAML Issuer

mattchoi2 opened this issue · comments

When using Auth0 SAML issuer url formatted in the following way:

https://dev-abcdef12345.us.auth0.com/samlp/12384569fjkdjfenj123

The saml2aws CLI does not properly parse the URL and returns the following:

Error authenticating to IdP.: error failed to build authentication info: error extractClientInfo: error invalid Auth0 URL      

This originates from this line of code. I believe it needs to be updated to properly parse URLs that include .us like follows:

authURLPattern        = regexp.MustCompile(`https://([^.]+[^.]+)(?:\.us|)\.auth0\.com/samlp/(.+)`)

This way it can match SAML issuer URLs that contain .us, but also still support URLs that do not.

Can you submit a PR with tests to fix this? @mattchoi2