Only map principals when both realms are non-null
@@ -585,7 +585,7 @@ public abstract class AbstractOperation {
String targetRealm = providerParameters.getRealm();
String sourceRealm = tokenResponse.getTokenRealm();
- if (sourceRealm != null && !sourceRealm.equals(targetRealm)) {
+ if (sourceRealm != null && targetRealm != null && !sourceRealm.equals(targetRealm)) {
RelationshipResolver relRes = stsProperties.getRelationshipResolver();
Relationship relationship = null;
if (relRes != null) {
@@ -619,7 +619,7 @@ public abstract class AbstractOperation {
// principal remains unchanged
} else {
- LOG.log(Level.SEVERE, "Unkown federation type: " + relationship.getType());
+ LOG.log(Level.SEVERE, "Unknown federation type: " + relationship.getType());
throw new STSException("Error in providing a token", STSException.BAD_REQUEST);
}
}
