Class InMemoryIdentityStore

java.lang.Object
cloud.piranha.micro.core.InMemoryIdentityStore
All Implemented Interfaces:
jakarta.security.enterprise.identitystore.IdentityStore

@ApplicationScoped public class InMemoryIdentityStore extends Object implements jakarta.security.enterprise.identitystore.IdentityStore
A basic in-memory identity store.

This identity store functions as the default identity store for among others Servlet security.

Author:
Arjan Tijms
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    The credential.

    Nested classes/interfaces inherited from interface jakarta.security.enterprise.identitystore.IdentityStore

    jakarta.security.enterprise.identitystore.IdentityStore.ValidationType
  • Field Summary

    Fields inherited from interface jakarta.security.enterprise.identitystore.IdentityStore

    DEFAULT_VALIDATION_TYPES
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Add the credential.
    static void
    addCredential​(String callerName, String password, List<String> groups)
    Add the credential.
    Returns the caller to credentials map.
    getCallerGroups​(jakarta.security.enterprise.identitystore.CredentialValidationResult validationResult)
     
    jakarta.security.enterprise.identitystore.CredentialValidationResult
    validate​(jakarta.security.enterprise.credential.UsernamePasswordCredential usernamePasswordCredential)
    Validate the username password credential.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface jakarta.security.enterprise.identitystore.IdentityStore

    priority, validate, validationTypes
  • Constructor Details

    • InMemoryIdentityStore

      public InMemoryIdentityStore()
  • Method Details

    • getCALLER_TO_CREDENTIALS

      public static Map<String,​InMemoryIdentityStore.Credential> getCALLER_TO_CREDENTIALS()
      Returns the caller to credentials map.
      Returns:
      the caller to credentials map
    • addCredential

      public static void addCredential(String callerName, String password, List<String> groups)
      Add the credential.
      Parameters:
      callerName - the caller name.
      password - the password.
      groups - the groups.
    • addCredential

      public static void addCredential(InMemoryIdentityStore.Credential credential)
      Add the credential.
      Parameters:
      credential - the credential.
    • validate

      public jakarta.security.enterprise.identitystore.CredentialValidationResult validate(jakarta.security.enterprise.credential.UsernamePasswordCredential usernamePasswordCredential)
      Validate the username password credential.
      Parameters:
      usernamePasswordCredential - the username password credential.
      Returns:
      the credential validation result.
    • getCallerGroups

      public Set<String> getCallerGroups(jakarta.security.enterprise.identitystore.CredentialValidationResult validationResult)
      Specified by:
      getCallerGroups in interface jakarta.security.enterprise.identitystore.IdentityStore