Advanced tasks > Using FileMaker ID for external authentication

Using FileMaker ID for external authentication

If you want to use the Claris FileMaker Data API or the OData API with FileMaker Cloud, you must authenticate using your FileMaker ID. FileMaker Cloud uses Amazon Cognito for external authentication.

Amazon Cognito manages users through user pools, which provide services such as sign-in, authentication with identity providers, user directory and profile management, and security monitoring. (See Amazon Cognito User Pools.)

To authenticate using FileMaker ID:

1. Retrieve values for the UserPoolId and ClientId parameters.

Amazon Cognito requires a UserPoolId and a ClientId to authenticate users. FileMaker Cloud provides the following endpoint:

The endpoint returns the following results:

"Region": "us-west-2",
"API_Host": "",
"FCC_Host": ""

Note  The returned Region and API_Host values are not used for authentication.

2. Use the Amazon Cognito Identity SDK for JavaScript to authenticate a user through Amazon Cognito. (See Amazon Cognito Identity SDK for JavaScript.) Use the example below in your JavaScript code to retrieve values for the FileMaker ID token (FileMaker_ID_token) and the FileMaker ID refresh token (FileMaker_ID_refresh_token).

The FileMaker ID token is used for authentication when you use the FileMaker Data API or OData API, and is valid for one hour. The FileMaker ID refresh token allows scripts to continue running after the FileMaker ID token expires, and is valid for one year.


In this example:

the UserPool_ID and Client_ID values from above are used

for username and password, enter the FileMaker ID user name and password

Example code:

var authenticationData = {
Username : 'username',
Password : 'password',
var authenticationDetails = new AmazonCognitoIdentity.AuthenticationDetails(authenticationData);
var poolData = { UserPoolId : 'us-west-2_NqkuZcXQY',
ClientId : '4l9rvl4mv5es1eep1qe97cautn'
var userPool = new AmazonCognitoIdentity.CognitoUserPool(poolData);
var userData = {
Username : 'username',
Pool : userPool
var cognitoUser = new AmazonCognitoIdentity.CognitoUser(userData);
cognitoUser.authenticateUser(authenticationDetails, {
onSuccess: function (result) {
var Cognito_access_token = result.getAccessToken().getJwtToken();
var FileMaker_ID_token = result.idToken.jwtToken;
var FileMaker_ID_refresh_token = result.refreshToken.token;
onFailure: function(err) {