Package com.logicaldoc.core.security.authentication

# Class ApiKeyAuthenticator

java.lang.Object
com.logicaldoc.core.security.authentication.AbstractAuthenticator
com.logicaldoc.core.security.authentication.DefaultAuthenticator
com.logicaldoc.core.security.authentication.ApiKeyAuthenticator

All Implemented Interfaces:
  `Authenticator`

@Component("apiKeyAuthenticator") public class ApiKeyAuthenticator extends DefaultAuthenticator
This authenticator uses the API Key

Since:
  8.9.4
Author:
  Marco Meschieri - LogicalDOC

## Constructor Summary

Constructors
Constructor
Description
`ApiKeyAuthenticator()`

## Method Summary

Modifier and Type
Method
Description
`User`
`authenticate(String username, String password)`
Authenticates the user using the given credentials, if successful, the corresponding user is returned.
`User`
`authenticate(String username, String password, String apikey, Client client)`
Authenticates the user using the given credentials, if successful, the corresponding user is returned.

### Methods inherited from class com.logicaldoc.core.security.authentication.DefaultAuthenticator

`pickUser, validateUser`

### Methods inherited from class com.logicaldoc.core.security.authentication.AbstractAuthenticator

`authenticate, canAuthenticateUser, isEnabled`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ApiKeyAuthenticator

public ApiKeyAuthenticator()

## Method Details

### authenticate

public User authenticate(String username, String password) throws AuthenticationException
Description copied from interface: `Authenticator`
Authenticates the user using the given credentials, if successful, the corresponding user is returned.

Specified by:
  `authenticate` in interface `Authenticator`
Overrides:
  `authenticate` in class `DefaultAuthenticator`
Parameters:
  `username` - the username
  `password` - the password
Returns:
  The user, or null if the authentication was unsuccessful
Throws:
  `AuthenticationException`

### authenticate

public User authenticate(String username, String password, String apikey, Client client) throws AuthenticationException
Description copied from interface: `Authenticator`
Authenticates the user using the given credentials, if successful, the corresponding user is returned.

Specified by:
  `authenticate` in interface `Authenticator`
Overrides:
  `authenticate` in class `DefaultAuthenticator`
Parameters:
  `username` - the username
  `password` - the password
  `apikey` - Optional third authentication parameter
  `client` - Client informations
Returns:
  The user, or null if the authentication was unsuccessful
Throws:
  `AuthenticationException`