add SAML Auth hook (#2730)

New hooks:
    samlGotAuthnResponse
    samlGenerateAuthnRequest
This commit is contained in:
Maxime Besson 2022-03-17 17:06:49 +01:00
parent 0998530118
commit 6d3f40b2fd
2 changed files with 11 additions and 0 deletions

View File

@ -185,6 +185,12 @@ sub extractFormInfo {
return PE_SAML_SSO_ERROR;
}
# Call samlGotAuthnResponse
my $h =
$self->p->processHook( $req, 'samlGotAuthnResponse', $idp,
$login );
return PE_SAML_SSO_ERROR if ( $h != PE_OK );
# Check Destination
return PE_SAML_DESTINATION_ERROR
unless ( $self->checkDestination( $saml_response, $url ) );

View File

@ -1024,6 +1024,11 @@ sub createAuthnRequest {
}
}
# Call samlGenerateAuthnRequest hook
my $h =
$self->p->processHook( $req, 'samlGenerateAuthnRequest', $idp, $login );
return if ( $h != PE_OK );
# Build authentication request
unless ( $self->buildAuthnRequestMsg($login) ) {
$self->logger->error("Could not build authentication request on $idp");