43 |
43 |
** 024 IAS 20190703 Changed support for SET-DB-CLIENT for non-default domains
|
44 |
44 |
** 025 OM 20190709 Optimize imports. Dropped unused statements.
|
45 |
45 |
** 026 EVL 20190719 Adding temporary workaround for validateCP() in certain condtions.
|
|
46 |
** 027 IAS 20190820 Fixed temporary workaround for validateCP().
|
46 |
47 |
*/
|
47 |
48 |
|
48 |
49 |
/*
|
... | ... | |
203 |
204 |
/** Reversed polynomial used with the CRC-16 algorithm. */
|
204 |
205 |
private static final int REVERSED_POLYNOMIAL = 0xA001;
|
205 |
206 |
|
|
207 |
/** Special authentication domain types */
|
|
208 |
private static final Set<String> SPECIAL_AUTH_SYSTEMS = Collections.unmodifiableSet(
|
|
209 |
new HashSet<String>()
|
|
210 |
{{
|
|
211 |
add("_extsso");
|
|
212 |
add("_oslocal");
|
|
213 |
}}
|
|
214 |
);
|
|
215 |
|
206 |
216 |
/** The current _User security handler for emulation of USERID and SETUSERID P4GL functions. */
|
207 |
217 |
private static CustomSecurityOps customSecurityOps = instantiateUserHandler();
|
208 |
218 |
|
... | ... | |
741 |
751 |
*/
|
742 |
752 |
public static void readDomains(String db, Persistence persistence)
|
743 |
753 |
{
|
|
754 |
// prevent next attempts to read from the same db
|
|
755 |
local.get().dbDomains.putIfAbsent(db.toLowerCase(), new HashMap());
|
|
756 |
local.get().dbDomainTypes.putIfAbsent(db.toLowerCase(), new HashMap());
|
744 |
757 |
try
|
745 |
758 |
{
|
|
759 |
// TODO read authentication callback name and related fields
|
746 |
760 |
String queryDomainTypes = "SELECT DOMAIN_TYPE, DOMAIN_TYPE_DESCRIPTION, PAM_PLUG_IN "
|
747 |
761 |
+ "FROM SEC_AUTHENTICATION_SYSTEM";
|
748 |
762 |
ConnectionManager.readQueryResults(queryDomainTypes, persistence, rs -> {
|
... | ... | |
3648 |
3662 |
readUsers(db, persistence);
|
3649 |
3663 |
users = local.get().getUsers(db);
|
3650 |
3664 |
}
|
3651 |
|
/* EVL*** temporary workaround for validation issue
|
3652 |
3665 |
if (!local.get().domainsLoaded(db))
|
3653 |
3666 |
{
|
3654 |
3667 |
readDomains(db, persistence);
|
3655 |
3668 |
}
|
3656 |
3669 |
Domain domain = local.get().findDomain(db, clientPrincipal.getDomainName().getValue());
|
3657 |
|
boolean isDefaultDomainType = domain != null && "_oeusertable".equals(domain.type.name.toLowerCase());
|
3658 |
|
*/
|
3659 |
|
Domain domain = null;
|
3660 |
|
boolean isDefaultDomainType = true;
|
|
3670 |
// TODO: add support for special domains type and authentication callback
|
|
3671 |
boolean isDefaultDomainType = domain != null &&
|
|
3672 |
!SPECIAL_AUTH_SYSTEMS.contains(domain.type.name.toLowerCase());
|
3661 |
3673 |
|
3662 |
3674 |
LoginState loginState = LoginState.valueOf(
|
3663 |
3675 |
clientPrincipal.getLoginState().toStringMessage()
|