Source:
<code>public Set<Identity> getIdentities(Account account) { if (!isConfigured()) { return new HashSet<>(); } String accessToken = (String) DataAccessor.fields(account).withKey(ServiceAuthConstants.ACCESS_TOKEN).get(); if (tokenUtil.findAndSetJWT()) { ApiRequest request = ApiContext.getContext().getApiRequest(); request.setAttribute(ServiceAuthConstants.ACCESS_TOKEN, accessToken); return tokenUtil.getIdentities(); } else if(ServiceAuthConstants.NO_IDENTITY_LOOKUP_SUPPORTED.get()) { Set<Identity> identities = new HashSet<>(); <START> identities.add(new Identity(account.getExternalIdType(), account.getExternalId())); <END> return identities; } String jwt = null; if (SecurityConstants.SECURITY.get() && !StringUtils.isBlank(accessToken)) { AuthToken authToken = authTokenDao.getTokenByAccountId(account.getId()); if (authToken == null) { Token token = refreshToken(accessToken); if (token != null) { jwt = ProjectConstants.AUTH_TYPE + token.getJwt(); authToken = authTokenDao.createToken(token.getJwt(), token.getAuthProvider(), account.getId(), account.getId()); jwt = authToken.getKey(); accessToken = (String) DataAccessor.fields(account).withKey(ServiceAuthConstants.ACCESS_TOKEN).get(); } } else { jwt = authToken.getKey(); } } if (StringUtils.isBlank(jwt)){ return Collections.emptySet(); } ApiRequest request = ApiContext.getContext().getApiRequest(); request.setAttribute(tokenUtil.tokenType(), jwt); request.setAttribute(ServiceAuthConstants.ACCESS_TOKEN, accessToken); return tokenUtil.getIdentities(); }</code><technical_language>totally sure, getIdentity this check setting identity true, do need do well? <LINK_0></technical_language>

Target:
public Set<Identity> getIdentities(Account account) { if (!isConfigured()) { return new HashSet<>(); } String accessToken = (String) DataAccessor.fields(account).withKey(ServiceAuthConstants.ACCESS_TOKEN).get(); if (tokenUtil.findAndSetJWT()) { ApiRequest request = ApiContext.getContext().getApiRequest(); request.setAttribute(ServiceAuthConstants.ACCESS_TOKEN, accessToken); return tokenUtil.getIdentities(); } else if(ServiceAuthConstants.NO_IDENTITY_LOOKUP_SUPPORTED.get()) { Set<Identity> identities = new HashSet<>(); if (StringUtils.equals(account.getExternalIdType(), ServiceAuthConstants.USER_TYPE.get())) { identities.add(new Identity(account.getExternalIdType(), account.getExternalId(), null, null, null, null, true)); } return identities; } String jwt = null; if (SecurityConstants.SECURITY.get() && !StringUtils.isBlank(accessToken)) { AuthToken authToken = authTokenDao.getTokenByAccountId(account.getId()); if (authToken == null) { Token token = refreshToken(accessToken); if (token != null) { jwt = ProjectConstants.AUTH_TYPE + token.getJwt(); authToken = authTokenDao.createToken(token.getJwt(), token.getAuthProvider(), account.getId(), account.getId()); jwt = authToken.getKey(); accessToken = (String) DataAccessor.fields(account).withKey(ServiceAuthConstants.ACCESS_TOKEN).get(); } } else { jwt = authToken.getKey(); } } if (StringUtils.isBlank(jwt)){ return Collections.emptySet(); } ApiRequest request = ApiContext.getContext().getApiRequest(); request.setAttribute(tokenUtil.tokenType(), jwt); request.setAttribute(ServiceAuthConstants.ACCESS_TOKEN, accessToken); return tokenUtil.getIdentities(); }