Tabnine Logo
CredentialValidationResult.getCallerGroups
Code IndexAdd Tabnine to your IDE (free)

How to use
getCallerGroups
method
in
javax.security.enterprise.identitystore.CredentialValidationResult

Best Java code snippets using javax.security.enterprise.identitystore.CredentialValidationResult.getCallerGroups (Showing top 9 results out of 315)

origin: javaee/security-soteria

@Override
public AuthenticationStatus notifyContainerAboutLogin(CredentialValidationResult result) {
  if (result.getStatus() == VALID) {
    return notifyContainerAboutLogin(
        result.getCallerPrincipal(),
        result.getCallerGroups());
  } 
    
  return SEND_FAILURE;
}
origin: org.glassfish.soteria/javax.security.enterprise

@Override
public AuthenticationStatus notifyContainerAboutLogin(CredentialValidationResult result) {
  if (result.getStatus() == VALID) {
    return notifyContainerAboutLogin(
        result.getCallerPrincipal(),
        result.getCallerGroups());
  } 
    
  return SEND_FAILURE;
}
origin: javaee-samples/javaee8-samples

/**
 * Create the JWT using CredentialValidationResult received from
 * IdentityStoreHandler
 *
 * @param result the result from validation of UsernamePasswordCredential
 * @param context
 * @return the AuthenticationStatus to notify the container
 */
private AuthenticationStatus createToken(CredentialValidationResult result, HttpMessageContext context) {
  if (!isRememberMe(context)) {
    String jwt = tokenProvider.createToken(result.getCallerPrincipal().getName(), result.getCallerGroups(), false);
    context.getResponse().setHeader(AUTHORIZATION_HEADER, BEARER + jwt);
  }
  return context.notifyContainerAboutLogin(result.getCallerPrincipal(), result.getCallerGroups());
}
origin: org.glassfish.soteria/javax.security.enterprise

groups.addAll(validationResult.getCallerGroups());
origin: javaee/security-soteria

groups.addAll(validationResult.getCallerGroups());
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();
}
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: org.glassfish.soteria/javax.security.enterprise

    result.getCallerPrincipal(), result.getCallerGroups());
} else {
origin: javaee/security-soteria

    result.getCallerPrincipal(), result.getCallerGroups());
} else {
javax.security.enterprise.identitystoreCredentialValidationResultgetCallerGroups

Javadoc

Determines the set of groups that the specified Caller is in, based on the associated identity store.

Popular methods of CredentialValidationResult

  • <init>
    Private constructor.
  • getCallerPrincipal
    Return the CallerPrincipal for the validated credential.
  • getStatus
    Determines the validation status.
  • getCallerDn
    Return the CallerPrincipal for the validated credential.
  • getCallerUniqueId
    Return a string that uniquely identifies this caller within the identity store (since the Principal
  • getIdentityStoreId
    Return the unique ID of the identity store used to validate the credentials.

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Option (scala)
  • Top plugins for WebStorm
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