Hi,
I have a question on implementing logout functionality in modules in correlation with re-authentication (forced authentication when user is already logged in).
During user authn, I save association with particular Relying Party (RP, Service Provider (SP) counterpart in SAML) using \SimpleSAML\Session::setData(...), and also registered a logout handler function using \SimpleSAML\Session::registerLogoutHandler(...).
In my registered logout handler function I retrieve all saved RP associations and send an OIDC logout requests to them so that each RPs can clear their local session.
Up to now, this all works fine - whenever I call $session->doLogout($authSourceId),
my logout handler gets called and logout requests to RPs are successfully sent.
However, I have problems with re-authentication. For instance, OIDC client can request authentication using
promt=login
parameter even if the user is already authenticated (similar to 'forceAuthn' in SAML).
So, when I get promt=login, I do authentication again, for example using - \SimpleSAML\Auth\Simple::login($authSourceId). However, the problem is - in the process it comes down to \SimpleSAML\Session::doLogin($authSourceId), and in that method there is a check
```
if (isset($this->authData[$authority])) {
// we are already logged in, log the user out first
$this->doLogout($authority);
}
```
So, the logout gets called, and again, my logout handler gets called which in turn sends logout requests to all RPs (which I don't actually want for re-authentication)...
What I'm trying to do is to make OIDC module handle logout for OIDC RPs whenever
a logout is called on particular authentication source. For example, a user performs authn using SAML on some SP and also performs authn using OIDC on some RP. Then, user initiates logout using SAML on SP - in this case I also want to send OIDC logout requests to authenticated RPs...
My questions are:
* is the registered logout handler function the right place to send logout requests to RPs? If not, where else?
* is there a way to do re-authentication without doing logout, that is without calling logout handlers?
Any other advice is welcome...
Thank you in advance
Marko Ivančić