Skip to content

Commit

Permalink
Merge pull request #833 from honza889/sac-invalidname
Browse files Browse the repository at this point in the history
[ELY-1115] SAC: InvalidNameState for non-existing identities
  • Loading branch information
darranl committed May 30, 2017
2 parents 33b416d + 6abb18c commit 03e583d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,9 @@ State assignName(final SecurityIdentity capturedIdentity, final MechanismConfigu
} else {
realmIdentity = securityRealm.getRealmIdentity(finalPrincipal);
}
if (! realmIdentity.exists()) {
return new InvalidNameState(capturedIdentity, mechanismConfiguration, mechanismRealmConfiguration, privateCredentials, publicCredentials);
}
return new NameAssignedState(capturedIdentity, realmInfo, realmIdentity, preRealmPrincipal, mechanismConfiguration, mechanismRealmConfiguration, privateCredentials, publicCredentials);
}

Expand Down Expand Up @@ -1705,6 +1708,11 @@ MechanismRealmConfiguration getMechanismRealmConfiguration() {
return mechanismRealmConfiguration;
}

@Override
RealmIdentity getRealmIdentity() {
return RealmIdentity.NON_EXISTENT;
}

@Override
void fail() {
final AtomicReference<State> stateRef = getStateRef();
Expand Down

0 comments on commit 03e583d

Please sign in to comment.