use of javax.security.auth.login.CredentialNotFoundException in project tomee by apache.
the class TomcatSecurityService method login.
public UUID login(final String realmName, final String username, final String password) throws LoginException {
final Realm realm = findRealm(realmName);
if (realm == null) {
throw new LoginException("No Tomcat realm available");
}
final Principal principal = realm.authenticate(username, password);
if (principal == null) {
throw new CredentialNotFoundException(username);
}
final Subject subject = createSubject(realm, principal);
return registerSubject(subject);
}
Aggregations