[Minor] added authenticateSingleSignOn method
This commit is contained in:
parent
adf53dd49f
commit
283a78bdfa
|
@ -133,6 +133,22 @@ public class DefaultStrolchPrivilegeHandler extends StrolchComponent implements
|
||||||
return certificate;
|
return certificate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Certificate authenticateSingleSignOn(Object data) {
|
||||||
|
assertContainerStarted();
|
||||||
|
Certificate certificate = this.privilegeHandler.authenticateSingleSignOn(data);
|
||||||
|
StrolchRealm realm = getContainer().getRealm(certificate);
|
||||||
|
try (StrolchTransaction tx = realm.openTx(certificate, StrolchPrivilegeConstants.LOGIN)) {
|
||||||
|
tx.setSuppressDoNothingLogging(true);
|
||||||
|
tx.setSuppressAudits(true);
|
||||||
|
// the id should be set with the username!! But how to get from data?
|
||||||
|
Audit audit = tx.auditFrom(AccessType.CREATE, StrolchPrivilegeConstants.PRIVILEGE,
|
||||||
|
StrolchPrivilegeConstants.CERTIFICATE, "sso");
|
||||||
|
tx.getAuditTrail().add(tx, audit);
|
||||||
|
}
|
||||||
|
return certificate;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PrivilegeContext validate(Certificate certificate) throws PrivilegeException {
|
public PrivilegeContext validate(Certificate certificate) throws PrivilegeException {
|
||||||
return this.privilegeHandler.validate(certificate);
|
return this.privilegeHandler.validate(certificate);
|
||||||
|
|
|
@ -43,6 +43,19 @@ public interface PrivilegeHandler {
|
||||||
*/
|
*/
|
||||||
Certificate authenticate(String username, char[] password);
|
Certificate authenticate(String username, char[] password);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Authenticates a user on a remote Single Sign On service. This is implemented by the
|
||||||
|
*
|
||||||
|
* @param data
|
||||||
|
* the data to perform the SSO
|
||||||
|
*
|
||||||
|
* @return the {@link Certificate} for the user
|
||||||
|
*
|
||||||
|
* @throws PrivilegeException
|
||||||
|
* if something goes wrong with the SSO
|
||||||
|
*/
|
||||||
|
Certificate authenticateSingleSignOn(Object data) throws PrivilegeException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link PrivilegeContext} for the given certificate
|
* Returns the {@link PrivilegeContext} for the given certificate
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue