public boolean exists() throws RealmUnavailableException { return authenticationIdentity.exists(); }
/** * Determine if the current authentication identity actually exists in the realm. * * @return {@code true} if the identity exists, {@code false} otherwise * @throws RealmUnavailableException if the realm failed to access the identity * @throws IllegalStateException if there is no authentication name set */ public boolean exists() throws RealmUnavailableException, IllegalStateException { return stateRef.get().getRealmIdentity().exists(); }
/** * Get an authorization identity for this pre-authenticated identity. * * @return the authorization identity (may not be {@code null}) * * @throws IllegalStateException if called for an identity that does not exist * @throws RealmUnavailableException if the realm is not able to handle requests for any reason */ default AuthorizationIdentity getAuthorizationIdentity() throws RealmUnavailableException { if (exists()) { return AuthorizationIdentity.EMPTY; } else { throw log.userDoesNotExist(); } }
private boolean runAsPrincipalExists(final SecurityDomain securityDomain, final String runAsPrincipal) throws RealmUnavailableException { RealmIdentity realmIdentity = null; try { realmIdentity = securityDomain.getIdentity(runAsPrincipal); return realmIdentity.exists(); } finally { if (realmIdentity != null) { realmIdentity.dispose(); } } } }
boolean ok = false; try { if (! realmIdentity.exists()) { ElytronMessages.log.tracef("Authorization failed - identity does not exists"); return false;
if (!realmIdentity.exists()) { log.tracef("RealmIdentity for '%s' does not exist, skipping cache.'", principal); return realmIdentity;
AuthorizedAuthenticationState doAuthorization(final boolean requireLoginPermission) throws RealmUnavailableException { final RealmIdentity realmIdentity = this.realmIdentity; if (! realmIdentity.exists()) { ElytronMessages.log.trace("Authorization failed - realm identity does not exists"); return null;
public boolean exists() throws RealmUnavailableException { return authenticationIdentity.exists(); }
public boolean exists() throws RealmUnavailableException { return authenticationIdentity.exists(); }
public boolean exists() throws RealmUnavailableException { return authenticationIdentity.exists(); }
/** * Determine if the current authentication identity actually exists in the realm. * * @return {@code true} if the identity exists, {@code false} otherwise * @throws RealmUnavailableException if the realm failed to access the identity * @throws IllegalStateException if there is no authentication name set */ public boolean exists() throws RealmUnavailableException, IllegalStateException { return stateRef.get().getRealmIdentity().exists(); }
/** * Determine if the current authentication identity actually exists in the realm. * * @return {@code true} if the identity exists, {@code false} otherwise * @throws RealmUnavailableException if the realm failed to access the identity * @throws IllegalStateException if there is no authentication name set */ public boolean exists() throws RealmUnavailableException, IllegalStateException { return stateRef.get().getRealmIdentity().exists(); }
/** * Determine if the current authentication identity actually exists in the realm. * * @return {@code true} if the identity exists, {@code false} otherwise * @throws RealmUnavailableException if the realm failed to access the identity * @throws IllegalStateException if there is no authentication name set */ public boolean exists() throws RealmUnavailableException, IllegalStateException { return stateRef.get().getRealmIdentity().exists(); }
/** * Get an authorization identity for this pre-authenticated identity. * * @return the authorization identity (may not be {@code null}) * * @throws IllegalStateException if called for an identity that does not exist * @throws RealmUnavailableException if the realm is not able to handle requests for any reason */ default AuthorizationIdentity getAuthorizationIdentity() throws RealmUnavailableException { if (exists()) { return AuthorizationIdentity.EMPTY; } else { throw log.userDoesNotExist(); } }
/** * Get an authorization identity for this pre-authenticated identity. * * @return the authorization identity (may not be {@code null}) * * @throws IllegalStateException if called for an identity that does not exist * @throws RealmUnavailableException if the realm is not able to handle requests for any reason */ default AuthorizationIdentity getAuthorizationIdentity() throws RealmUnavailableException { if (exists()) { return AuthorizationIdentity.EMPTY; } else { throw log.userDoesNotExist(); } }
/** * Get an authorization identity for this pre-authenticated identity. * * @return the authorization identity (may not be {@code null}) * * @throws IllegalStateException if called for an identity that does not exist * @throws RealmUnavailableException if the realm is not able to handle requests for any reason */ default AuthorizationIdentity getAuthorizationIdentity() throws RealmUnavailableException { if (exists()) { return AuthorizationIdentity.EMPTY; } else { throw log.userDoesNotExist(); } }
static boolean runAsPrincipalExists(final SecurityDomain securityDomain, final String runAsPrincipal) { RealmIdentity realmIdentity = null; try { realmIdentity = securityDomain.getIdentity(runAsPrincipal); return realmIdentity.exists(); } catch (RealmUnavailableException e) { // TODO Throw a replcement exception throw new IllegalStateException(String.format("Unable to obtain identity for name %s", runAsPrincipal), e); //throw UndertowLogger.ROOT_LOGGER.unableToObtainIdentity(runAsPrincipal, e); } finally { if (realmIdentity != null) { realmIdentity.dispose(); } } }
boolean ok = false; try { if (! realmIdentity.exists()) { ElytronMessages.log.tracef("Authorization failed - identity does not exists"); return false;
AuthorizedAuthenticationState doAuthorization(final boolean requireLoginPermission) throws RealmUnavailableException { final RealmIdentity realmIdentity = this.realmIdentity; if (! realmIdentity.exists()) { ElytronMessages.log.trace("Authorization failed - realm identity does not exists"); return null;
AuthorizedAuthenticationState doAuthorization(final boolean requireLoginPermission) throws RealmUnavailableException { final RealmIdentity realmIdentity = this.realmIdentity; if (! realmIdentity.exists()) { ElytronMessages.log.trace("Authorization failed - realm identity does not exists"); return null;