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) intintInteger from 0 to 4 0 Weak (guesses invalid input: '<' 3^10) 1 Fair (guesses invalid input: '<' 6^10) 2 Good (guesses invalid input: '<' 8^10) 3 Strong (guesses invalid input: '<' 10^10) 4 Very strong (guesses >= 10^10)static io.undertow.util.HttpStringstatic io.undertow.util.HttpStringgetXForwardedHeaderName(String suffix) static io.undertow.util.HttpStringvoidinit()booleanbooleanvoidsetUsersDb(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.AccountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.restheart.plugins.ConfigurablePlugin
arg, argOrDefault
-
Field Details
-
X_FORWARDED_ACCOUNT_ID
- See Also:
-
X_FORWARDED_ROLE
- See Also:
-
-
Constructor Details
-
MongoRealmAuthenticator
public MongoRealmAuthenticator()
-
-
Method Details
-
init
public void init() -
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
public int getBcryptComplexity()- Returns:
- the bcryptComplexity
-
isBcryptHashedPassword
public boolean isBcryptHashedPassword()- Returns:
- true if the password must be hashed
-
getMinimumPasswordStrength
public int getMinimumPasswordStrength()Integer from 0 to 4 0 Weak (guesses invalid input: '<' 3^10) 1 Fair (guesses invalid input: '<' 6^10) 2 Good (guesses invalid input: '<' 8^10) 3 Strong (guesses invalid input: '<' 10^10) 4 Very strong (guesses >= 10^10)- Returns:
- the minimumPasswordStrength
-
isEnforceMinimumPasswordStrength
public boolean isEnforceMinimumPasswordStrength()- Returns:
- true if the password st be hashed
-
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
-
getJsonPathRoles
- Returns:
- the jsonPathRoles
-