congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
HttpMessageContext.doNothing
Code IndexAdd Tabnine to your IDE (free)

How to use
doNothing
method
in
javax.security.enterprise.authentication.mechanism.http.HttpMessageContext

Best Java code snippets using javax.security.enterprise.authentication.mechanism.http.HttpMessageContext.doNothing (Showing top 11 results out of 315)

origin: javax/javaee-web-api

@Override
public AuthenticationStatus doNothing() {
  return getWrapped().doNothing();
}
origin: jboss/jboss-javaee-specs

@Override
public AuthenticationStatus doNothing() {
  return getWrapped().doNothing();
}
origin: javax.security.enterprise/javax.security.enterprise-api

@Override
public AuthenticationStatus doNothing() {
  return getWrapped().doNothing();
}
origin: jakarta.security.enterprise/jakarta.security.enterprise-api

@Override
public AuthenticationStatus doNothing() {
  return getWrapped().doNothing();
}
origin: javaee/security-soteria

@Override
public AuthenticationStatus validateRequest(HttpServletRequest request, HttpServletResponse response, HttpMessageContext httpMessageContext) throws AuthenticationException {
  
  if (isValidFormPostback(request)) {
    IdentityStoreHandler identityStoreHandler = CDI.current().select(IdentityStoreHandler.class).get();
    
    return httpMessageContext.notifyContainerAboutLogin(
        identityStoreHandler.validate(
        new UsernamePasswordCredential(
          request.getParameter("j_username"), 
          new Password(request.getParameter("j_password")))));
  }
  
  return httpMessageContext.doNothing();
}

origin: org.glassfish.soteria/javax.security.enterprise

@Override
public AuthenticationStatus validateRequest(HttpServletRequest request, HttpServletResponse response, HttpMessageContext httpMessageContext) throws AuthenticationException {
  
  if (isValidFormPostback(request)) {
    IdentityStoreHandler identityStoreHandler = CDI.current().select(IdentityStoreHandler.class).get();
    
    return httpMessageContext.notifyContainerAboutLogin(
        identityStoreHandler.validate(
        new UsernamePasswordCredential(
          request.getParameter("j_username"), 
          new Password(request.getParameter("j_password")))));
  }
  
  return httpMessageContext.doNothing();
}

origin: org.glassfish.soteria/javax.security.enterprise

@Override
public AuthenticationStatus validateRequest(HttpServletRequest request, HttpServletResponse response, HttpMessageContext httpMessageContext) throws AuthenticationException {
  
  if (hasCredential(httpMessageContext)) {
    IdentityStoreHandler identityStoreHandler = CDI.current().select(IdentityStoreHandler.class).get();
    
    return httpMessageContext.notifyContainerAboutLogin(
        identityStoreHandler.validate(
        httpMessageContext.getAuthParameters()
                 .getCredential()));
  }
  
  return httpMessageContext.doNothing();
}

origin: javaee/security-soteria

@Override
public AuthenticationStatus validateRequest(HttpServletRequest request, HttpServletResponse response, HttpMessageContext httpMessageContext) throws AuthenticationException {
  
  if (hasCredential(httpMessageContext)) {
    IdentityStoreHandler identityStoreHandler = CDI.current().select(IdentityStoreHandler.class).get();
    
    return httpMessageContext.notifyContainerAboutLogin(
        identityStoreHandler.validate(
        httpMessageContext.getAuthParameters()
                 .getCredential()));
  }
  
  return httpMessageContext.doNothing();
}

origin: javaee-samples/javaee8-samples

return context.doNothing();
origin: org.glassfish.soteria/javax.security.enterprise

@Override
public AuthenticationStatus validateRequest(HttpServletRequest request, HttpServletResponse response, HttpMessageContext httpMsgContext) throws AuthenticationException {
  String[] credentials = getCredentials(request);
  if (!isEmpty(credentials)) {
    IdentityStoreHandler identityStoreHandler = CDI.current().select(IdentityStoreHandler.class).get();
    CredentialValidationResult result = identityStoreHandler.validate(
        new UsernamePasswordCredential(credentials[0], new Password(credentials[1])));
    if (result.getStatus() == VALID) {
      return httpMsgContext.notifyContainerAboutLogin(
        result.getCallerPrincipal(), result.getCallerGroups());
    }
  }
  if (httpMsgContext.isProtected()) {
    response.setHeader("WWW-Authenticate", format("Basic realm=\"%s\"", basicAuthenticationMechanismDefinition.realmName()));
    return httpMsgContext.responseUnauthorized();
  }
  return httpMsgContext.doNothing();
}
origin: javaee/security-soteria

@Override
public AuthenticationStatus validateRequest(HttpServletRequest request, HttpServletResponse response, HttpMessageContext httpMsgContext) throws AuthenticationException {
  String[] credentials = getCredentials(request);
  if (!isEmpty(credentials)) {
    IdentityStoreHandler identityStoreHandler = CDI.current().select(IdentityStoreHandler.class).get();
    CredentialValidationResult result = identityStoreHandler.validate(
        new UsernamePasswordCredential(credentials[0], new Password(credentials[1])));
    if (result.getStatus() == VALID) {
      return httpMsgContext.notifyContainerAboutLogin(
        result.getCallerPrincipal(), result.getCallerGroups());
    }
  }
  if (httpMsgContext.isProtected()) {
    response.setHeader("WWW-Authenticate", format("Basic realm=\"%s\"", basicAuthenticationMechanismDefinition.realmName()));
    return httpMsgContext.responseUnauthorized();
  }
  return httpMsgContext.doNothing();
}
javax.security.enterprise.authentication.mechanism.httpHttpMessageContextdoNothing

Javadoc

Instructs the container to "do nothing".

When intending to do nothing, a JSR 375 authentication mechanism has to indicate this explicitly via its return value.

As a convenience this method returns NOT_DONE, so this method can be used in one fluent return statement from an HttpAuthenticationMechanism

Popular methods of HttpMessageContext

  • getRequest
    Returns the request object associated with the current request.
  • getResponse
    Returns the response object associated with the current request.
  • isProtected
    Checks if the currently requested resource is protected or not. A protected resource is a resource (
  • notifyContainerAboutLogin
    Convenience method intended to pass the CredentialValidationResult result of an identity store direc
  • responseUnauthorized
    Sets the response status to 401 (unauthorized). As a convenience this method returns SEND_FAILURE, s
  • forward
    Forwards to another resource (servlet, JSP file, or HTML file) on the server. As a convenience this
  • getAuthParameters
    Returns the parameters that were provided with the SecurityContext#authenticate(AuthParameters) call
  • getCallerPrincipal
    Gets the Principal set by a call to notifyContainerAboutLogin().
  • getClientSubject
    Returns the subject for which authentication is to take place.Note: This is a low level object that
  • getGroups
    Gets the groups set by a call to notifyContainerAboutLogin().
  • getHandler
    Returns the low level JSR 196 handler that the runtime provided when creating this HttpMessageContex
  • getMessageInfo
    Returns the the low level JSR 196 message info instance for the current request.Note: This is a low
  • getHandler,
  • getMessageInfo,
  • isAuthenticationRequest,
  • redirect,
  • withRequest,
  • cleanClientSubject,
  • isRegisterSession,
  • responseNotFound,
  • setRegisterSession

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • getResourceAsStream (ClassLoader)
  • startActivity (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now