SecurityContext.isAuthenticationRequired
Code IndexAdd Codota to your IDE (free)

Best code snippets using io.undertow.security.api.SecurityContext.isAuthenticationRequired(Showing top 7 results out of 315)

  • Common ways to obtain SecurityContext
private void myMethod () {
SecurityContext s =
  • HttpServerExchange httpServerExchange;httpServerExchange.getSecurityContext()
  • Smart code suggestions by Codota
}
origin: wildfly/wildfly

/**
 * <p>The authentication is mandatory if the servlet has http constraints (eg.: {@link
 * javax.servlet.annotation.HttpConstraint}).</p>
 *
 * @param attachment
 * @return
 */
private Boolean isMandatory(final ServletRequestContext attachment) {
  return attachment.getExchange().getSecurityContext() != null && attachment.getExchange().getSecurityContext().isAuthenticationRequired();
}
origin: wildfly/wildfly

private Certificate[] getPeerCertificates(final HttpServerExchange exchange, SSLSessionInfo sslSession, SecurityContext securityContext) throws SSLPeerUnverifiedException {
  try {
    return sslSession.getPeerCertificates();
  } catch (RenegotiationRequiredException e) {
    //we only renegotiate if authentication is required
    if (forceRenegotiation && securityContext.isAuthenticationRequired()) {
      try {
        sslSession.renegotiate(exchange, SslClientAuthMode.REQUESTED);
        return sslSession.getPeerCertificates();
      } catch (IOException e1) {
        //ignore
      } catch (RenegotiationRequiredException e1) {
        //ignore
      }
    }
  }
  throw new SSLPeerUnverifiedException("");
}
origin: wildfly/wildfly

@Override
public boolean resolve(HttpServerExchange value) {
  SecurityContext sc = value.getSecurityContext();
  if(sc == null) {
    return false;
  }
  return sc.isAuthenticationRequired();
}
origin: org.wildfly/wildfly-undertow

/**
 * <p>The authentication is mandatory if the servlet has http constraints (eg.: {@link
 * javax.servlet.annotation.HttpConstraint}).</p>
 *
 * @param attachment
 * @return
 */
private Boolean isMandatory(final ServletRequestContext attachment) {
  return attachment.getExchange().getSecurityContext() != null && attachment.getExchange().getSecurityContext().isAuthenticationRequired();
}
origin: io.undertow/undertow-core

@Override
public boolean resolve(HttpServerExchange value) {
  SecurityContext sc = value.getSecurityContext();
  if(sc == null) {
    return false;
  }
  return sc.isAuthenticationRequired();
}
origin: org.wildfly/wildfly-undertow

/**
 * <p>The authentication is mandatory if the servlet has http constraints (eg.: {@link
 * javax.servlet.annotation.HttpConstraint}).</p>
 *
 * @param attachment
 * @return
 */
private Boolean isMandatory(final ServletRequestContext attachment) {
  return attachment.getExchange().getSecurityContext() != null && attachment.getExchange().getSecurityContext().isAuthenticationRequired();
}
origin: io.undertow/undertow-core

private Certificate[] getPeerCertificates(final HttpServerExchange exchange, SSLSessionInfo sslSession, SecurityContext securityContext) throws SSLPeerUnverifiedException {
  try {
    return sslSession.getPeerCertificates();
  } catch (RenegotiationRequiredException e) {
    //we only renegotiate if authentication is required
    if (forceRenegotiation && securityContext.isAuthenticationRequired()) {
      try {
        sslSession.renegotiate(exchange, SslClientAuthMode.REQUESTED);
        return sslSession.getPeerCertificates();
      } catch (IOException e1) {
        //ignore
      } catch (RenegotiationRequiredException e1) {
        //ignore
      }
    }
  }
  throw new SSLPeerUnverifiedException("");
}
io.undertow.security.apiSecurityContextisAuthenticationRequired

Javadoc

Returns true if authentication is required

Popular methods of SecurityContext

  • authenticationComplete
    Called by the AuthenticationMechanism to indicate that an account has been successfully authenticate
  • getAuthenticatedAccount
    Obtain the Account for the currently authenticated identity.
  • getIdentityManager
    Obtain the associated IdentityManager to use to make account verification decisions.
  • isAuthenticated
  • authenticate
    Performs authentication on the request. If authentication is REQUIRED then setAuthenticationRequired
  • authenticationFailed
    Called by the AuthenticationMechanism to indicate that an authentication attempt has failed. This sh
  • getMechanismName
  • setAuthenticationRequired
    Marks this request as requiring authentication. Authentication challenge headers will only be sent i
  • registerNotificationReceiver
    Register a NotificationReceiver interested in receiving notifications for security events that happe
  • addAuthenticationMechanism
    Adds an authentication mechanism to this context. When #authenticate() is called mechanisms will be
  • login
    Attempts to log the user in using the provided credentials. This result will be stored in the curren
  • logout
    de-authenticates the current exchange.
  • login,
  • logout

Popular classes and methods

  • setScale (BigDecimal)
    Returns a new BigDecimal instance with the specified scale. If the new scale is greater than the old
  • getExternalFilesDir (Context)
  • getContentResolver (Context)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • URL (java.net)
    Class URL represents a Uniform Resource Locator, a pointer to a "resource" on the World Wide Web.
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • TreeMap (java.util)
    A map whose entries are sorted by their keys. All optional operations such as #put and #remove are s
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)