a guest Apr 17th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #! python3
- from urllib.parse import quote_plus
- def create_aws_relay_state(idp, target):
- Provided an identity provider url as a string and a target url as string,
- we will create an ADFS relay state. I don't know why we need to run the
- quote_plus funciton twice, other than we need to re-encode all of the %
- symbols a second time.
- rpi = quote_plus(quote_plus('urn:amazon:webservices'))
- encoded_target = quote_plus(quote_plus(target))
- relay_state = idp + '?RelayState=RPID%3D' + rpi + '%26RelayState%3D' + encoded_target
- return relay_state
RAW Paste Data