Closed NemindaPiyasena closed 1 year ago
Thank you for taking the time to make this contribution. Since the payload you are seeing is starting to look like a URL query string, would it make more sense to do something like:
qs, err := url.ParseQuery(ev.Request.PostData)
if err != nil {
c.Logger.Errorf("Error parsing SAMLResponse: %v", err)
return
}
escsaml := qs.Get("SAMLResponse")
I think either approach will work, but wanted to propose an alternative to see if one feels like a better solution compared to the other. For what we're trying to accomplish here, I don't see a clear preference for how this is addressed.
Hi @mmmorris1975
Thank you for your input. Parsing as a query string makes more sense in the context. I have made the changes accordingly.
Thanks again for taking time to make aws-runas better! I'll work on getting this added in a new release
SAMLResponse=xxxx
key value pair was selected from the POST request response data. It looked for a return of aSAMLResponse=xxxx
examining the browser events.RelayState=xxxx
. If this key value pair is in the response after theSAMLResponse=xxxx
, the captured string from the browser events would look likeSAMLResponse=xxxx&RelayState=xxxx
. This would result in abase64
decoding error becase of the&
character.SAMLResponse=xxxx
key value pair using regex.