Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request fixes the issues of saml2aws not having the ability to hop multiple request chains to follow keycloak brokers, as well as the issue of it not carrying cookies along with the requests in this chain, which would result in it failing to do any multi-provider hops.
I mentioned the issue this is solving in #1395
After looking at how the keycloak authentication chain operates, I've managed to add a flag called "kc-broker" for logging in. This flag you can give a valid kc-broker name, (specified in your keycloak configuration). Keycloak will then take this broker and follow through to the target broker, beginning the authentication chain. Once this process begins the only necessary component that needed adding to saml2aws was for saml2aws to carry cookies forward along the request chain.
This avoids the usage of the browser mode, for requests that stay within the keycloak ecosystem, and allows usage of keychain to store credentials for accounts in other federations.
It passes all tests, and works similar to other flags. This could likely be expanded to other providers in the case the authentication has to go through several different sources to fully authenticate.