Now mapping is fault tollerant to support all kind of clients
This commit is contained in:
parent
db882bd0bf
commit
faf59e9d00
|
@ -7,6 +7,8 @@ import java.util.Map;
|
|||
|
||||
public class SlashSeparatedContextMapper extends AbstractOIDCToSitesAndRolesMapper {
|
||||
|
||||
private static final Boolean FAULT_TOLLERANT = Boolean.TRUE;
|
||||
|
||||
private static final String SPLIT_REGEXP = "/";
|
||||
|
||||
private static final int MINIMUM_TOKENS = 2;
|
||||
|
@ -40,8 +42,13 @@ public class SlashSeparatedContextMapper extends AbstractOIDCToSitesAndRolesMapp
|
|||
logger.debug("Tokens are: " + siteTokens.length);
|
||||
}
|
||||
if (siteTokens.length < MINIMUM_TOKENS) {
|
||||
throw new SitesMapperExecption(
|
||||
"Found " + siteTokens.length + " tokens only. Minimum should be: " + MINIMUM_TOKENS);
|
||||
String message = "Found " + siteTokens.length + " tokens only. Minimum should be: " + MINIMUM_TOKENS;
|
||||
if (FAULT_TOLLERANT) {
|
||||
logger.warn(message);
|
||||
continue;
|
||||
} else {
|
||||
throw new SitesMapperExecption(message);
|
||||
}
|
||||
}
|
||||
String rootVO = siteTokens[ROOT_VO_TOKEN_INDEX];
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
|
Loading…
Reference in New Issue