Class MongoRealmAuthenticator

java.lang.Object
org.restheart.security.authenticators.MongoRealmAuthenticator
All Implemented Interfaces:
io.undertow.security.idm.IdentityManager, ConfigurablePlugin, Plugin, Authenticator

public class MongoRealmAuthenticator extends Object implements Authenticator
Author:
Andrea Di Cesare <andrea@softinstigate.com>
  • Field Details

  • Constructor Details

    • MongoRealmAuthenticator

      public MongoRealmAuthenticator()
  • Method Details

    • setConf

      public void setConf(Map<String,Object> args)
    • setMongoClient

      public void setMongoClient(com.mongodb.client.MongoClient mclient)
    • setRegistry

      public void setRegistry(PluginsRegistry registry)
    • verify

      public io.undertow.security.idm.Account verify(io.undertow.security.idm.Account account)
      Specified by:
      verify in interface Authenticator
      Specified by:
      verify in interface io.undertow.security.idm.IdentityManager
    • verify

      public io.undertow.security.idm.Account verify(String id, io.undertow.security.idm.Credential credential)
      Specified by:
      verify in interface Authenticator
      Specified by:
      verify in interface io.undertow.security.idm.IdentityManager
    • getBcryptComplexity

      public Integer getBcryptComplexity()
      Returns:
      the bcryptComplexity
    • isBcryptHashedPassword

      public boolean isBcryptHashedPassword()
    • verify

      public io.undertow.security.idm.Account verify(io.undertow.security.idm.Credential credential)
      Specified by:
      verify in interface Authenticator
      Specified by:
      verify in interface io.undertow.security.idm.IdentityManager
    • accountIdTrasformer

      protected String accountIdTrasformer(String id)
      Override this method to trasform the account id. By default it returns the id without any transformation. For example, it could be overridden to force the id to be lowercase.
      Parameters:
      id - the account id
      Returns:
      the trasformed account Id (default is identity)
    • getPropPassword

      public String getPropPassword()
      Returns:
      the propPassword
    • getXForwardedHeaderName

      public static io.undertow.util.HttpString getXForwardedHeaderName(String suffix)
    • getXForwardedAccountIdHeaderName

      public static io.undertow.util.HttpString getXForwardedAccountIdHeaderName()
    • getXForwardedRolesHeaderName

      public static io.undertow.util.HttpString getXForwardedRolesHeaderName()
    • checkUserCollection

      public boolean checkUserCollection() throws IllegalStateException
      Throws:
      IllegalStateException
    • countAccounts

      public long countAccounts()
    • createDefaultAccount

      public void createDefaultAccount()
    • findAccount

      public MongoRealmAccount findAccount(String accountId)
    • getUsersDb

      public String getUsersDb()
      Returns:
      the usersDb
    • setUsersDb

      public void setUsersDb(String usersDb)
      Parameters:
      usersDb - the usersDb to set
    • getUsersCollection

      public String getUsersCollection()
      Returns:
      the usersCollection