use of it.spid.cie.oidc.callback.RelyingPartyLogoutCallback in project spid-cie-oidc-java by italia.
the class SpidController method logout.
@GetMapping("/logout")
public RedirectView logout(@RequestParam Map<String, String> params, final HttpServletRequest request, HttpServletResponse response) throws Exception {
String userKey = GetterUtil.getString(request.getSession().getAttribute("USER"));
String redirectURL = relyingPartyWrapper.performLogout(userKey, new RelyingPartyLogoutCallback() {
@Override
public void logout(String userKey, AuthnRequest authnRequest, AuthnToken authnToken) {
request.getSession().removeAttribute("USER");
request.getSession().removeAttribute("USER_INFO");
}
});
if (!Validator.isNullOrEmpty(redirectURL)) {
return new RedirectView(redirectURL);
}
return new RedirectView("landing");
}
Aggregations