* @see de.innovationgate.webgate.api.WGDatabaseCore#openSession(java.lang.String, java.lang.String)
*/
public WGUserAccess openSession(AuthenticationSession authSession, Object pwd, boolean master) throws WGAPIException {
if (master && !_specs.isUseMasterLogin()) {
return new WGUserAccess(authSession.getDistinguishedName(), WGDatabase.ACCESSLEVEL_READER);
}
String pwdStr = (String) pwd;
int accLevel;
try {
accLevel = login(authSession.getDistinguishedName(), pwdStr);
}
catch (WGAuthorisationException e) {
return new WGUserAccess(authSession.getDistinguishedName(), WGDatabase.ACCESSLEVEL_NOTLOGGEDIN);
}
catch (WGAPIException e) {
WGFactory.getLogger().error("Error opening scs session", e);
return new WGUserAccess(authSession.getDistinguishedName(), WGDatabase.ACCESSLEVEL_NOTLOGGEDIN);
}
if (accLevel > WGDatabase.ACCESSLEVEL_NOACCESS) {
userName.set(authSession.getDistinguishedName());
}
return new WGUserAccess(authSession.getDistinguishedName(), accLevel);
}