This service allows users to generate security tokens using a user account name and password.
By default, a token is tied to the client's credentials (username and password) and is valid for a specific period of time. A token can be retrieved by:
- Logging into the FME Server Web User Interface.
- Issuing a request from the token service in a web browser.
- Programmatically, such as through the REST API.
Token authentication provides a convenient way for your web applications to invoke the FME Server Web Services. Instead of embedding pregenerated tokens into an application, your application should request a token from the token service dynamically using user name and password via HTTPS. Once the token is obtained, the application can apply it to service requests via HTTP. In this context tokens should have short lifetime to be secure, such as one day.
Token authentication is applicable to the following FME Server Web Services:
- Data Download Service
- Job Submitter Service
- Data Streaming Service
- KML Network Link Service
Token Expiration Time
The maximum life of any token generated is two years. This means if you were to generate a token with a three-year expiration time, it would still be limited to 2 years. You may wish to shorten the maximum length of the token expiration for higher security in your application. To modify this setting, update the MAX_EXPIRATION parameter in the configuration file (propertiesFile.properties) found in the fmetoken webservice folder (<FMEServerDir>/Utilities/tomcat/webapps/fmetoken/WEB-INF/conf). For more information, see Web Application Properties.
To return a token as plain text:
To return a token in JSON:
The supported parameters are:
The user ID
The user password
The token's expiration time
The unit of expiration time (optional), expressed as
The following example generates a new token in JSON for user "admin" that expires in three days.
The following is an example JSON response document of a token request:
"expirationDate": "2017-11-23 21:14:52"