Fix parsing of broker user ID if it contains a dot (#32699)
Closes #32698 Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
This commit is contained in:
parent
ca951c3002
commit
9454c01d88
2 changed files with 6 additions and 6 deletions
|
@ -367,11 +367,11 @@ public class InfinispanUserSessionProvider implements UserSessionProvider, Sessi
|
||||||
}
|
}
|
||||||
|
|
||||||
if (predicate.getBrokerUserId() != null) {
|
if (predicate.getBrokerUserId() != null) {
|
||||||
String[] idpAliasSessionId = predicate.getBrokerUserId().split("\\.");
|
int split = predicate.getBrokerUserId().indexOf('.');
|
||||||
|
|
||||||
Map<String, String> attributes = new HashMap<>();
|
Map<String, String> attributes = new HashMap<>();
|
||||||
attributes.put(UserModel.IDP_ALIAS, idpAliasSessionId[0]);
|
attributes.put(UserModel.IDP_ALIAS, predicate.getBrokerUserId().substring(0, split));
|
||||||
attributes.put(UserModel.IDP_USER_ID, idpAliasSessionId[1]);
|
attributes.put(UserModel.IDP_USER_ID, predicate.getBrokerUserId().substring(split + 1));
|
||||||
|
|
||||||
UserProvider userProvider = session.getProvider(UserProvider.class);
|
UserProvider userProvider = session.getProvider(UserProvider.class);
|
||||||
UserModel userModel = userProvider.searchForUserStream(realm, attributes, 0, null).findFirst().orElse(null);
|
UserModel userModel = userProvider.searchForUserStream(realm, attributes, 0, null).findFirst().orElse(null);
|
||||||
|
|
|
@ -326,11 +326,11 @@ public class PersistentUserSessionProvider implements UserSessionProvider, Sessi
|
||||||
}
|
}
|
||||||
|
|
||||||
if (predicate.getBrokerUserId() != null) {
|
if (predicate.getBrokerUserId() != null) {
|
||||||
String[] idpAliasSessionId = predicate.getBrokerUserId().split("\\.");
|
int split = predicate.getBrokerUserId().indexOf('.');
|
||||||
|
|
||||||
Map<String, String> attributes = new HashMap<>();
|
Map<String, String> attributes = new HashMap<>();
|
||||||
attributes.put(UserModel.IDP_ALIAS, idpAliasSessionId[0]);
|
attributes.put(UserModel.IDP_ALIAS, predicate.getBrokerUserId().substring(0, split));
|
||||||
attributes.put(UserModel.IDP_USER_ID, idpAliasSessionId[1]);
|
attributes.put(UserModel.IDP_USER_ID, predicate.getBrokerUserId().substring(split + 1));
|
||||||
|
|
||||||
UserProvider userProvider = session.getProvider(UserProvider.class);
|
UserProvider userProvider = session.getProvider(UserProvider.class);
|
||||||
UserModel userModel = userProvider.searchForUserStream(realm, attributes, 0, null).findFirst().orElse(null);
|
UserModel userModel = userProvider.searchForUserStream(realm, attributes, 0, null).findFirst().orElse(null);
|
||||||
|
|
Loading…
Reference in a new issue