Skip to content

Commit 3b9910c

Browse files
authored
feat(jans-core): improve compatibility to allow get jansExtUid value … (#8459)
feat(jans-core): improve compatibility to allow get jansExtUid value as custom attribute Signed-off-by: Yuriy Movchan <[email protected]> Former-commit-id: 0febaa4
1 parent c301ce9 commit 3b9910c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

jans-core/model/src/main/java/io/jans/model/user/SimpleUser.java

+9
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@ public void setCustomObjectClasses(String[] customObjectClasses) {
136136

137137
public String getAttribute(String attributeName) {
138138
Object objectAttribute = getAttributeObject(attributeName);
139+
140+
// This code part we need to remove in future. It's for compatibility with existing scripts.
141+
if ((objectAttribute == null) && attributeName.equalsIgnoreCase("jansExtUid")) {
142+
String[] externalUids = getExternalUid();
143+
if ((externalUids != null) && (externalUids.length > 0)) {
144+
return externalUids[0];
145+
}
146+
147+
}
139148

140149
return StringHelper.toString(objectAttribute);
141150
}

0 commit comments

Comments
 (0)