Usages
- API Authenticator Plugin is used as an extension or replacement for the default authentication methods available in the API Builder.
- This plugin type must extend org.joget.api.model.ApiAuthenticatorAbstract abstract class.
POM file adjustments
Add the project dependencies below:
<!-- Add this dependency for authenticate(...) params --> <dependency> <groupId>javax.servlet</groupId> <artifactId>jsp-api</artifactId> <version>2.0</version> </dependency> <!-- Add apibuilder_api dependency --> <dependency> <groupId>org.joget.api</groupId> <artifactId>apibuilder_api</artifactId> <version>${project.version}</version> <scope>provided</scope> </dependency>
Abstract Class
org.joget.api.model.ApiAuthenticatorAbstract
- Under apibuilder_api module
- Extended org.joget.plugin.base.ExtDefaultPlugin. Please refer to Plugin Base Abstract Class and Interface.
- Implemented org.joget.plugin.property.model.PropertyEditable. Please refer to Plugin Base Abstract Class and Interface.
- Implemented org.joget.api.model.ApiAuthenticator.
- A base abstract class to develop a custom API Authenticator Plugin.
Abstract Methods
authenticate
public boolean authenticate(HttpServletRequest request, HttpServletResponse response);
Used to authenticate API calls on an existing API document.
Parameters:
request - the http request information
response - the http response to write
Plugin Properties Options
- Please refer to Plugin Properties Options for more information.
Sample Plugins
- Basic Authenticator - basic-authenticator.zip