Skip to content
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

auth_saml2 Ignore invalid idp request parameters #873

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion classes/auth.php
Original file line number Diff line number Diff line change
@@ -619,7 +619,14 @@ public function saml_login() {
$this->error_page(get_string('noidpfound', 'auth_saml2', $idpalias));
}
} else if (isset($_GET['idp'])) {
$SESSION->saml2idp = $_GET['idp'];
// Requested IDP by parameter.
$idp == $_GET['idp'];
// Check it exists in our list of valid IDP's otherwise ignore it, the default should be used instead.
foreach ($this->metadataentities as $md5identityhash => $idpentity) {
if ($idp == $md5identityhash) {
$SESSION->saml2idp = $idpentity->md5entityid;
}
}
} else if (!is_null($this->defaultidp)) {
$SESSION->saml2idp = $this->defaultidp->md5entityid;
} else if ($this->multiidp) {