/** * Attempt to create a new identity that can be used to run as an anonymous user. If the * current identity is not authorized to run as an anonymous user, an exception is thrown. * * Calling with enabled security manager requires {@code setRunAsPrincipal} {@link ElytronPermission}. * {@link org.wildfly.security.auth.permission.LoginPermission} granted to the anonymous identity will be required. * * @return the new security identity * @throws SecurityException if the operation authorization failed for any reason */ public SecurityIdentity createRunAsAnonymous() throws SecurityException { return createRunAsAnonymous(true); }
newIdentity = currentIdentity.createRunAsAnonymous(); } catch (AuthorizationFailureException ex) { newIdentity = currentIdentity.createRunAsAnonymous(false);
/** * Attempt to create a new identity that can be used to run as an anonymous user. If the * current identity is not authorized to run as an anonymous user, an exception is thrown. * * Calling with enabled security manager requires {@code setRunAsPrincipal} {@link ElytronPermission}. * {@link org.wildfly.security.auth.permission.LoginPermission} granted to the anonymous identity will be required. * * @return the new security identity * @throws SecurityException if the operation authorization failed for any reason */ public SecurityIdentity createRunAsAnonymous() throws SecurityException { return createRunAsAnonymous(true); }
/** * Attempt to create a new identity that can be used to run as an anonymous user. If the * current identity is not authorized to run as an anonymous user, an exception is thrown. * * Calling with enabled security manager requires {@code setRunAsPrincipal} {@link ElytronPermission}. * {@link org.wildfly.security.auth.permission.LoginPermission} granted to the anonymous identity will be required. * * @return the new security identity * @throws SecurityException if the operation authorization failed for any reason */ public SecurityIdentity createRunAsAnonymous() throws SecurityException { return createRunAsAnonymous(true); }
/** * Attempt to create a new identity that can be used to run as an anonymous user. If the * current identity is not authorized to run as an anonymous user, an exception is thrown. * * Calling with enabled security manager requires {@code setRunAsPrincipal} {@link ElytronPermission}. * {@link org.wildfly.security.auth.permission.LoginPermission} granted to the anonymous identity will be required. * * @return the new security identity * @throws SecurityException if the operation authorization failed for any reason */ public SecurityIdentity createRunAsAnonymous() throws SecurityException { return createRunAsAnonymous(true); }
if (runAsPrincipal.equals(ANONYMOUS_PRINCIPAL)) { try { newIdentity = newIdentity.createRunAsAnonymous(); } catch (AuthorizationFailureException ex) { newIdentity = newIdentity.createRunAsAnonymous(false);