-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config to disable discovery initiated SAMLBackend flows #322
base: master
Are you sure you want to change the base?
Config to disable discovery initiated SAMLBackend flows #322
Conversation
The current SAMLBackend allows a flow to start with the disco_response() endpoint, i.e., a client passing in the entityID of the IdP to be used for authentication. In most deployments the flow will fail after the backend receives the SAMLResponse, parses it, and passes control to the frontend since the frontend does not know to which relying party to redirect the browser. But it is possible for some deployments to make a flow that starts with the disco_response() work so just preventing such flows is not acceptable. This commit enables configuring the SAMLBackend so that flows are not allowed to be started at disco_response(), and when so configured a flow that starts at disco_response() will raise an exception with a useful message rather than continuing on to a frontend and failing with UnknownError.
Really usefull |
Here is a use case where allowing discovery initiated SAMLBackend flows remains important. Users do bookmark the discovery service (at the time they do it, it includes the return URL to SATOSA so the bookmark is in some sense valid). Yes, they should not do that, and education can help, but it cannot stop all users from bookmarking the discovery service. So rather than stopping the flow entirely, it is helpful to be able to allow the user to go to the IdP and authenticate. Then when the user returns, a microservice can detect there is no SP requestor, and direct the user to the VO dashboard, which contains a list of all SPs to which the user can connect. They can then click on the SP and go through the SSO flow and get to the SP, even though they started the day from the discovery service. I have one deployment that wants to support this scenario to help reduce the communications to the HelpDesk. |
Exactly, the same use case here. |
This feature Is really important, keep It on top of the agenda! |
The problem with starting a flow from the discovery-endpoint is that the proxy does not know what the originating SP really is. The proxy is lost and crashes. To resolve this, a configurable handler will be registered. The handler by default will stop the flow. A user will be able to configure this handler to provide different behaviour - for example redirecting to an error page or a service-selection page. This is similar to #324 and those two will be handled by a similar mechanism. |
or a default SP?
completely agree |
KEY_DISCO_SRV = 'disco_srv' | ||
KEY_SAML_DISCOVERY_INITIATED = 'saml_discovery_initiated' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skoranda could we adopt KEY_ALLOW_DISCO_INIT_CONFIG
only, without KEY_SAML_DISCOVERY_INITIATED
?
SAMLBackend.KEY_SAML_DISCOVERY_INITIATED, | ||
False) | ||
|
||
if (not self.config.get(SAMLBackend.KEY_ALLOW_DISCO_INIT_CONFIG, True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without KEY_SAML_DISCOVERY_INITIATED
it would be
if not self.config.get(SAMLBackend.KEY_ALLOW_DISCO_INIT_CONFIG, False):
# ....
The current SAMLBackend allows a flow to start with the
disco_response() endpoint, i.e., a client passing in the
entityID of the IdP to be used for authentication. In most
deployments the flow will fail after the backend receives the
SAMLResponse, parses it, and passes control to the frontend
since the frontend does not know to which relying party to redirect the
browser. But it is possible for some deployments to make a flow that
starts with the disco_response() work so just preventing such flows is
not acceptable. This commit enables configuring the SAMLBackend so that
flows are not allowed to be started at disco_response(), and when so
configured a flow that starts at disco_response() will raise an
exception with a useful message rather than continuing on to
a frontend and failing with UnknownError.
All Submissions: