Merge changes
parent
a55d61bd49
commit
392e6578ce
|
|
@ -55,6 +55,7 @@ public class SamlLoginModule implements LoginModule {
|
||||||
@Override
|
@Override
|
||||||
public boolean login() throws LoginException {
|
public boolean login() throws LoginException {
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
final HttpServletRequest httpRequest = getRequest();
|
final HttpServletRequest httpRequest = getRequest();
|
||||||
final HttpServletResponse httpResponse = getResponse();
|
final HttpServletResponse httpResponse = getResponse();
|
||||||
|
|
||||||
|
|
@ -64,6 +65,15 @@ public class SamlLoginModule implements LoginModule {
|
||||||
httpRequest,
|
httpRequest,
|
||||||
httpResponse);
|
httpResponse);
|
||||||
} catch (SettingsException ex) {
|
} catch (SettingsException ex) {
|
||||||
|
=======
|
||||||
|
final HttpServletRequest request = getRequest();
|
||||||
|
final HttpServletResponse response = getResponse();
|
||||||
|
|
||||||
|
final Auth auth;
|
||||||
|
try {
|
||||||
|
auth = new Auth(request, response);
|
||||||
|
} catch (IOException | SettingsException | Error ex) {
|
||||||
|
>>>>>>> SAML support for CCM
|
||||||
LOGGER.error("SAML Login failed.", ex);
|
LOGGER.error("SAML Login failed.", ex);
|
||||||
throw new LoginException("SAML Login failed. Configuration error?");
|
throw new LoginException("SAML Login failed. Configuration error?");
|
||||||
}
|
}
|
||||||
|
|
@ -87,6 +97,9 @@ public class SamlLoginModule implements LoginModule {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean commit() throws LoginException {
|
public boolean commit() throws LoginException {
|
||||||
|
if (userId != null) {
|
||||||
|
subject.getPrincipals().add(new PartyPrincipal(userId));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -97,6 +110,10 @@ public class SamlLoginModule implements LoginModule {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean logout() throws LoginException {
|
public boolean logout() throws LoginException {
|
||||||
|
getRequest().getSession().invalidate();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
protected HttpServletRequest getRequest() throws LoginException {
|
protected HttpServletRequest getRequest() throws LoginException {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -139,5 +156,4 @@ public class SamlLoginModule implements LoginModule {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue