@ FFDCIgnore ( EntryNotFoundException . class ) private String getMissingAccessId ( com . ibm . ws . javaee . dd . appbnd . Subject subjectFromArchive ) { String subjectType = null ; try { SecurityService securityService = securityServiceRef . getService ( ) ; UserRegistryService userRegistryService = securityService . getUserRegistryService ( ) ; if ( ! userRegistryService . isUserRegistryConfigured ( ) ) return null ; UserRegistry userRegistry = userRegistryService . getUserRegistry ( ) ; String realm = userRegistry . getRealm ( ) ; if ( subjectFromArchive instanceof Group ) { subjectType = "group" ; String groupUniqueId = userRegistry . getUniqueGroupId ( subjectFromArchive . getName ( ) ) ; return AccessIdUtil . createAccessId ( AccessIdUtil . TYPE_GROUP , realm , groupUniqueId ) ; } else if ( subjectFromArchive instanceof User ) { subjectType = "user" ; String uniqueId = userRegistry . getUniqueUserId ( subjectFromArchive . getName ( ) ) ; return AccessIdUtil . createAccessId ( AccessIdUtil . TYPE_USER , realm , uniqueId ) ; } } catch ( EntryNotFoundException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) ) { if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "No entry found for " + subjectType + " " + subjectFromArchive . getName ( ) + " found in user registry. Unable to create access ID." ) ; } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "EntryNotFoundException details:" , e ) ; } } } catch ( RegistryException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Unexpected exception getting the accessId for " + subjectFromArchive . getName ( ) + ": " + e ) ; } } return null ; }
Get the access id for a user or group in the bindings config by looking up the user registry .