io.vertx.ext.auth.mongo

## Interface MongoAuth

- All Superinterfaces:
    AuthenticationProvider, AuthProvider

  Deprecated.
  This class has been replaced by the class `MongoAuthentication` for authentication and `MongoAuthorization` for authorization

      public interface MongoAuth
      extends AuthProvider

  An extension of AuthProvider which is using `MongoClient` as store
  Author:
    mremme

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_COLLECTION_NAME` Deprecated. The default name of the collection to be used
    `static String` | `DEFAULT_CREDENTIAL_PASSWORD_FIELD` Deprecated. The default name of the property for the password, like it is transported in credentials by method `AuthenticationProvider.authenticate(JsonObject, Handler)`
    `static String` | `DEFAULT_CREDENTIAL_USERNAME_FIELD` Deprecated. The default name of the property for the username, like it is transported in credentials by method `AuthenticationProvider.authenticate(JsonObject, Handler)`
    `static String` | `DEFAULT_PASSWORD_FIELD` Deprecated. The default name of the property for the password, like it is stored in mongodb
    `static String` | `DEFAULT_PERMISSION_FIELD` Deprecated. The default name of the property for the permissions, like it is stored in mongodb.
    `static String` | `DEFAULT_ROLE_FIELD` Deprecated. The default name of the property for the roles, like it is stored in mongodb.
    `static String` | `DEFAULT_SALT_FIELD` Deprecated. The default name of the property for the salt field
    `static String` | `DEFAULT_USERNAME_FIELD` Deprecated. The default name of the property for the username, like it is stored in mongodb
    `static String` | `PROPERTY_COLLECTION_NAME` Deprecated. The property name to be used to set the name of the collection inside the config
    `static String` | `PROPERTY_CREDENTIAL_PASSWORD_FIELD` Deprecated. The property name to be used to set the name of the field, where the password for the credentials is stored inside
    `static String` | `PROPERTY_CREDENTIAL_USERNAME_FIELD` Deprecated. The property name to be used to set the name of the field, where the username for the credentials is stored inside
    `static String` | `PROPERTY_PASSWORD_FIELD` Deprecated. The property name to be used to set the name of the field, where the password is stored inside
    `static String` | `PROPERTY_PERMISSION_FIELD` Deprecated. The property name to be used to set the name of the field, where the permissions are stored inside
    `static String` | `PROPERTY_ROLE_FIELD` Deprecated. The property name to be used to set the name of the field, where the roles are stored inside
    `static String` | `PROPERTY_SALT_FIELD` Deprecated. The property name to be used to set the name of the field, where the SALT is stored inside
    `static String` | `PROPERTY_SALT_STYLE` Deprecated. The property name to be used to set the name of the field, where the salt style is stored inside
    `static String` | `PROPERTY_USERNAME_FIELD` Deprecated. The property name to be used to set the name of the field, where the username is stored inside
    `static String` | `ROLE_PREFIX` Deprecated. The prefix which is used by the method `User.isAuthorized(String, Handler)` when checking for role access

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static MongoAuth` | `create(MongoClient mongoClient, JsonObject config)` Deprecated. Creates an instance of MongoAuth by using the given `MongoClient` and configuration object.
    `String` | `getCollectionName()` Deprecated. The name of the collection used to store User objects inside.
    `HashStrategy` | `getHashStrategy()` Deprecated. The HashStrategy which is used by the current instance
    `String` | `getPasswordCredentialField()` Deprecated. Get the name of the field to be used as property for the password of credentials in the method `AuthenticationProvider.authenticate(JsonObject, io.vertx.core.Handler)`.
    `String` | `getPasswordField()` Deprecated. Get the name of the field to be used for the password Defaults to `DEFAULT_PASSWORD_FIELD`
    `String` | `getPermissionField()` Deprecated. Get the name of the field to be used for the permissions.
    `String` | `getRoleField()` Deprecated. Get the name of the field to be used for the roles.
    `String` | `getSaltField()` Deprecated. Get the name of the field to be used for the salt.
    `String` | `getUsernameCredentialField()` Deprecated. Get the name of the field to be used as property for the username in the method `AuthenticationProvider.authenticate(JsonObject, io.vertx.core.Handler)`.
    `String` | `getUsernameField()` Deprecated. Get the name of the field to be used for the username.
    `default Future<String>` | `insertUser(String username, String password, List<String> roles, List<String> permissions)` Deprecated. Insert a new user into mongo in the convenient way
    `void` | `insertUser(String username, String password, List<String> roles, List<String> permissions, Handler<AsyncResult<String>> resultHandler)` Deprecated. Insert a new user into mongo in the convenient way
    `MongoAuth` | `setCollectionName(String collectionName)` Deprecated. Set the name of the collection to be used.
    `MongoAuth` | `setHashAlgorithm(HashAlgorithm hashAlgorithm)` Deprecated. The Hash Algorithm which is used by the current instance
    `MongoAuth` | `setHashStrategy(HashStrategy hashStrategy)` Deprecated. The HashStrategy which is used by the current instance
    `MongoAuth` | `setPasswordCredentialField(String fieldName)` Deprecated. Set the name of the field to be used as property for the password of credentials in the method `AuthenticationProvider.authenticate(JsonObject, io.vertx.core.Handler)`.
    `MongoAuth` | `setPasswordField(String fieldName)` Deprecated. Set the name of the field to be used for the password Defaults to `DEFAULT_PASSWORD_FIELD`
    `MongoAuth` | `setPermissionField(String fieldName)` Deprecated. Set the name of the field to be used for the permissions.
    `MongoAuth` | `setRoleField(String fieldName)` Deprecated. Set the name of the field to be used for the roles.
    `MongoAuth` | `setSaltField(String fieldName)` Deprecated. Set the name of the field to be used for the salt.
    `MongoAuth` | `setUsernameCredentialField(String fieldName)` Deprecated. Set the name of the field to be used as property for the username in the method `AuthenticationProvider.authenticate(JsonObject, io.vertx.core.Handler)`.
    `MongoAuth` | `setUsernameField(String fieldName)` Deprecated. Set the name of the field to be used for the username.

    - ### Methods inherited from interface io.vertx.ext.auth.authentication.AuthenticationProvider

      `authenticate, authenticate, authenticate, authenticate`

- - ### Field Detail

    - #### PROPERTY_COLLECTION_NAME

          static final String PROPERTY_COLLECTION_NAME

      Deprecated.
      The property name to be used to set the name of the collection inside the config
      See Also:
        Constant Field Values

    - #### PROPERTY_USERNAME_FIELD

          static final String PROPERTY_USERNAME_FIELD

      Deprecated.
      The property name to be used to set the name of the field, where the username is stored inside
      See Also:
        Constant Field Values

    - #### PROPERTY_ROLE_FIELD

          static final String PROPERTY_ROLE_FIELD

      Deprecated.
      The property name to be used to set the name of the field, where the roles are stored inside
      See Also:
        Constant Field Values

    - #### PROPERTY_PERMISSION_FIELD

          static final String PROPERTY_PERMISSION_FIELD

      Deprecated.
      The property name to be used to set the name of the field, where the permissions are stored inside
      See Also:
        Constant Field Values

    - #### PROPERTY_PASSWORD_FIELD

          static final String PROPERTY_PASSWORD_FIELD

      Deprecated.
      The property name to be used to set the name of the field, where the password is stored inside
      See Also:
        Constant Field Values

    - #### PROPERTY_CREDENTIAL_USERNAME_FIELD

          static final String PROPERTY_CREDENTIAL_USERNAME_FIELD

      Deprecated.
      The property name to be used to set the name of the field, where the username for the credentials is stored inside
      See Also:
        Constant Field Values

    - #### PROPERTY_CREDENTIAL_PASSWORD_FIELD

          static final String PROPERTY_CREDENTIAL_PASSWORD_FIELD

      Deprecated.
      The property name to be used to set the name of the field, where the password for the credentials is stored inside
      See Also:
        Constant Field Values

    - #### PROPERTY_SALT_FIELD

          static final String PROPERTY_SALT_FIELD

      Deprecated.
      The property name to be used to set the name of the field, where the SALT is stored inside
      See Also:
        Constant Field Values

    - #### PROPERTY_SALT_STYLE

          static final String PROPERTY_SALT_STYLE

      Deprecated.
      The property name to be used to set the name of the field, where the salt style is stored inside
      See Also:
        `HashSaltStyle`, Constant Field Values

    - #### DEFAULT_COLLECTION_NAME

          static final String DEFAULT_COLLECTION_NAME

      Deprecated.
      The default name of the collection to be used
      See Also:
        Constant Field Values

    - #### DEFAULT_USERNAME_FIELD

          static final String DEFAULT_USERNAME_FIELD

      Deprecated.
      The default name of the property for the username, like it is stored in mongodb
      See Also:
        Constant Field Values

    - #### DEFAULT_PASSWORD_FIELD

          static final String DEFAULT_PASSWORD_FIELD

      Deprecated.
      The default name of the property for the password, like it is stored in mongodb
      See Also:
        Constant Field Values

    - #### DEFAULT_ROLE_FIELD

          static final String DEFAULT_ROLE_FIELD

      Deprecated.
      The default name of the property for the roles, like it is stored in mongodb. Roles are expected to be saved as JsonArray
      See Also:
        Constant Field Values

    - #### DEFAULT_PERMISSION_FIELD

          static final String DEFAULT_PERMISSION_FIELD

      Deprecated.
      The default name of the property for the permissions, like it is stored in mongodb. Permissions are expected to be saved as JsonArray
      See Also:
        Constant Field Values

    - #### DEFAULT_CREDENTIAL_USERNAME_FIELD

          static final String DEFAULT_CREDENTIAL_USERNAME_FIELD

      Deprecated.
      The default name of the property for the username, like it is transported in credentials by method `AuthenticationProvider.authenticate(JsonObject, Handler)`
      See Also:
        Constant Field Values

    - #### DEFAULT_CREDENTIAL_PASSWORD_FIELD

          static final String DEFAULT_CREDENTIAL_PASSWORD_FIELD

      Deprecated.
      The default name of the property for the password, like it is transported in credentials by method `AuthenticationProvider.authenticate(JsonObject, Handler)`
      See Also:
        Constant Field Values

    - #### DEFAULT_SALT_FIELD

          static final String DEFAULT_SALT_FIELD

      Deprecated.
      The default name of the property for the salt field
      See Also:
        Constant Field Values

    - #### ROLE_PREFIX

          static final String ROLE_PREFIX

      Deprecated.
      The prefix which is used by the method `User.isAuthorized(String, Handler)` when checking for role access
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### create

          static MongoAuth create(MongoClient mongoClient,
                                  JsonObject config)

      Deprecated.
      Creates an instance of MongoAuth by using the given `MongoClient` and configuration object. An example for a configuration object:

           JsonObject js = new JsonObject();
           js.put(MongoAuth.PROPERTY_COLLECTION_NAME, createCollectionName(MongoAuth.DEFAULT_COLLECTION_NAME));

      Parameters:
        `mongoClient` - an instance of `MongoClient` to be used for data storage and retrival
        `config` - the configuration object for the current instance. By this
      Returns:
        the created instance of `MongoAuth`s

    - #### setCollectionName

          MongoAuth setCollectionName(String collectionName)

      Deprecated.
      Set the name of the collection to be used. Defaults to `DEFAULT_COLLECTION_NAME`
      Parameters:
        `collectionName` - the name of the collection to be used for storing and reading user data
      Returns:
        the current instance itself for fluent calls

    - #### setUsernameField

          MongoAuth setUsernameField(String fieldName)

      Deprecated.
      Set the name of the field to be used for the username. Defaults to `DEFAULT_USERNAME_FIELD`
      Parameters:
        `fieldName` - the name of the field to be used
      Returns:
        the current instance itself for fluent calls

    - #### setPasswordField

          MongoAuth setPasswordField(String fieldName)

      Deprecated.
      Set the name of the field to be used for the password Defaults to `DEFAULT_PASSWORD_FIELD`
      Parameters:
        `fieldName` - the name of the field to be used
      Returns:
        the current instance itself for fluent calls

    - #### setRoleField

          MongoAuth setRoleField(String fieldName)

      Deprecated.
      Set the name of the field to be used for the roles. Defaults to `DEFAULT_ROLE_FIELD`. Roles are expected to be saved as JsonArray
      Parameters:
        `fieldName` - the name of the field to be used
      Returns:
        the current instance itself for fluent calls

    - #### setPermissionField

          MongoAuth setPermissionField(String fieldName)

      Deprecated.
      Set the name of the field to be used for the permissions. Defaults to `DEFAULT_PERMISSION_FIELD`. Permissions are expected to be saved as JsonArray
      Parameters:
        `fieldName` - the name of the field to be used
      Returns:
        the current instance itself for fluent calls

    - #### setUsernameCredentialField

          MongoAuth setUsernameCredentialField(String fieldName)

      Deprecated.
      Set the name of the field to be used as property for the username in the method `AuthenticationProvider.authenticate(JsonObject, io.vertx.core.Handler)`. Defaults to `DEFAULT_CREDENTIAL_USERNAME_FIELD`
      Parameters:
        `fieldName` - the name of the field to be used
      Returns:
        the current instance itself for fluent calls

    - #### setPasswordCredentialField

          MongoAuth setPasswordCredentialField(String fieldName)

      Deprecated.
      Set the name of the field to be used as property for the password of credentials in the method `AuthenticationProvider.authenticate(JsonObject, io.vertx.core.Handler)`. Defaults to `DEFAULT_CREDENTIAL_PASSWORD_FIELD`
      Parameters:
        `fieldName` - the name of the field to be used
      Returns:
        the current instance itself for fluent calls

    - #### setSaltField

          MongoAuth setSaltField(String fieldName)

      Deprecated.
      Set the name of the field to be used for the salt. Only used when `HashStrategy.setSaltStyle(HashSaltStyle)` is set to `HashSaltStyle.COLUMN`
      Parameters:
        `fieldName` - the name of the field to be used
      Returns:
        the current instance itself for fluent calls

    - #### getCollectionName

          String getCollectionName()

      Deprecated.
      The name of the collection used to store User objects inside. Defaults to `DEFAULT_COLLECTION_NAME`
      Returns:
        the collectionName

    - #### getUsernameField

          String getUsernameField()

      Deprecated.
      Get the name of the field to be used for the username. Defaults to `DEFAULT_USERNAME_FIELD`
      Returns:
        the usernameField

    - #### getPasswordField

          String getPasswordField()

      Deprecated.
      Get the name of the field to be used for the password Defaults to `DEFAULT_PASSWORD_FIELD`
      Returns:
        the passwordField

    - #### getRoleField

          String getRoleField()

      Deprecated.
      Get the name of the field to be used for the roles. Defaults to `DEFAULT_ROLE_FIELD`. Roles are expected to be saved as JsonArray
      Returns:
        the roleField

    - #### getPermissionField

          String getPermissionField()

      Deprecated.
      Get the name of the field to be used for the permissions. Defaults to `DEFAULT_PERMISSION_FIELD`. Permissions are expected to be saved as JsonArray
      Returns:
        the permissionField

    - #### getUsernameCredentialField

          String getUsernameCredentialField()

      Deprecated.
      Get the name of the field to be used as property for the username in the method `AuthenticationProvider.authenticate(JsonObject, io.vertx.core.Handler)`. Defaults to `DEFAULT_CREDENTIAL_USERNAME_FIELD`
      Returns:
        the usernameCredentialField

    - #### getPasswordCredentialField

          String getPasswordCredentialField()

      Deprecated.
      Get the name of the field to be used as property for the password of credentials in the method `AuthenticationProvider.authenticate(JsonObject, io.vertx.core.Handler)`. Defaults to `DEFAULT_CREDENTIAL_PASSWORD_FIELD`
      Returns:
        the passwordCredentialField

    - #### getSaltField

          String getSaltField()

      Deprecated.
      Get the name of the field to be used for the salt. Only used when `HashStrategy.setSaltStyle(HashSaltStyle)` is set to `HashSaltStyle.COLUMN`
      Returns:
        the saltField

    - #### setHashStrategy

          MongoAuth setHashStrategy(HashStrategy hashStrategy)

      Deprecated.
      The HashStrategy which is used by the current instance
      Parameters:
        `hashStrategy` - the `HashStrategy` to be set
      Returns:
        the current instance itself for fluent calls

    - #### getHashStrategy

          HashStrategy getHashStrategy()

      Deprecated.
      The HashStrategy which is used by the current instance
      Returns:
        the defined instance of `HashStrategy`

    - #### setHashAlgorithm

          MongoAuth setHashAlgorithm(HashAlgorithm hashAlgorithm)

      Deprecated.
      The Hash Algorithm which is used by the current instance
      Parameters:
        `hashAlgorithm` - the `HashAlgorithm` to be set
      Returns:
        the current instance itself for fluent calls

    - #### insertUser

          void insertUser(String username,
                          String password,
                          List<String> roles,
                          List<String> permissions,
                          Handler<AsyncResult<String>> resultHandler)

      Deprecated.
      Insert a new user into mongo in the convenient way
      Parameters:
        `username` - the username to be set
        `password` - the passsword in clear text, will be adapted following the definitions of the defined `HashStrategy`
        `roles` - a list of roles to be set
        `permissions` - a list of permissions to be set
        `resultHandler` - the ResultHandler will be provided with the id of the generated record

    - #### insertUser

          default Future<String> insertUser(String username,
                                            String password,
                                            List<String> roles,
                                            List<String> permissions)

      Deprecated.
      Insert a new user into mongo in the convenient way
      Parameters:
        `username` - the username to be set
        `password` - the passsword in clear text, will be adapted following the definitions of the defined `HashStrategy`
        `roles` - a list of roles to be set
        `permissions` - a list of permissions to be set
      Returns:
        the result future will be provided with the id of the generated record
      See Also:
        `insertUser(String, String, List, List, Handler)`

Copyright © 2021 Eclipse. All rights reserved.