Class MongoRealmAuthenticator
java.lang.Object
org.restheart.security.authenticators.MongoRealmAuthenticator
- All Implemented Interfaces:
io.undertow.security.idm.IdentityManager,ConfigurablePlugin,Plugin,Authenticator
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringOverride this method to trasform the account id.booleanlongvoidfindAccount(String accountId) static io.undertow.util.HttpStringstatic io.undertow.util.HttpStringgetXForwardedHeaderName(String suffix) static io.undertow.util.HttpStringbooleanvoidvoidsetMongoClient(com.mongodb.client.MongoClient mclient) voidsetRegistry(PluginsRegistry registry) voidsetUsersDb(String usersDb) io.undertow.security.idm.Accountverify(io.undertow.security.idm.Account account) io.undertow.security.idm.Accountverify(io.undertow.security.idm.Credential credential) io.undertow.security.idm.Account
-
Field Details
-
X_FORWARDED_ACCOUNT_ID
- See Also:
-
X_FORWARDED_ROLE
- See Also:
-
-
Constructor Details
-
MongoRealmAuthenticator
public MongoRealmAuthenticator()
-
-
Method Details
-
setConf
-
setMongoClient
public void setMongoClient(com.mongodb.client.MongoClient mclient) -
setRegistry
-
verify
public io.undertow.security.idm.Account verify(io.undertow.security.idm.Account account) - Specified by:
verifyin interfaceAuthenticator- Specified by:
verifyin interfaceio.undertow.security.idm.IdentityManager
-
verify
public io.undertow.security.idm.Account verify(String id, io.undertow.security.idm.Credential credential) - Specified by:
verifyin interfaceAuthenticator- Specified by:
verifyin interfaceio.undertow.security.idm.IdentityManager
-
getBcryptComplexity
- Returns:
- the bcryptComplexity
-
isBcryptHashedPassword
public boolean isBcryptHashedPassword() -
verify
public io.undertow.security.idm.Account verify(io.undertow.security.idm.Credential credential) - Specified by:
verifyin interfaceAuthenticator- Specified by:
verifyin interfaceio.undertow.security.idm.IdentityManager
-
accountIdTrasformer
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
- Returns:
- the propPassword
-
getXForwardedHeaderName
-
getXForwardedAccountIdHeaderName
public static io.undertow.util.HttpString getXForwardedAccountIdHeaderName() -
getXForwardedRolesHeaderName
public static io.undertow.util.HttpString getXForwardedRolesHeaderName() -
checkUserCollection
- Throws:
IllegalStateException
-
countAccounts
public long countAccounts() -
createDefaultAccount
public void createDefaultAccount() -
findAccount
-
getUsersDb
- Returns:
- the usersDb
-
setUsersDb
- Parameters:
usersDb- the usersDb to set
-
getUsersCollection
- Returns:
- the usersCollection
-