Log in to a database session using an OAuth identity provider

To log in to a hosted database using an OAuth identity provider, use an API endpoint that points to the database. Use the X-FM-Data-OAuth-Request-Id string and X-FM-Data-OAuth-Identifier string in the header to authenticate access to the hosted database. If the authentication is accepted, you will receive a corresponding response from API endpoint.

HTTP method POST

URL

https://host /fmi/odata/version/database-name/$metadata

host – FileMaker Server host name

version – OData version, always v4

database-name – the name of the hosted database

HTTP header

Content-Type: application

X-FM-Data-OAuth-Request-Id: request-id

X-FM-Data-OAuth-Identifier: identifier-parameter

To get the OAuth parameters in JSON format:

  1. Get the list of supported OAuth providers by using an HTTP GET method with this URL:

    https://host/fmws/oauthproviderinfo

    where host is the IP address or domain name of the primary machine in your FileMaker Server deployment. The list is returned in JSON format.

  2. Choose a supported OAuth provider.

  3. Get the tracking ID for your session. Use an HTTP GET method with this URL:

    http://host/oauth/getoauthurl?trackingID=tracking-ID&provider=OAuth-provider&address=127.0.0.1&X-FMS-OAuth-AuthType=2

    where host is the IP address or domain name of the primary machine in your FileMaker Server deployment, tracking-ID is the developer-generated tracking ID for your session, and OAuth-provider is the name of your selected OAuth provider.

    The HTTP header for this request needs to include the following:

    • X-FMS-Application-Type: 9

    • X-FMS-Application-Version: 15

    • X-FMS-Return-URL: http://127.0.0.1/

  4. Read the response header for the X-FMS-Request-ID data. This response header contains the OAuth request ID that you will use for the X-FM-Data-OAuth-Request-ID string in the header.

  5. Read the response body for the X-FMS-Return-URL data. Call the URL returned in this parameter to allow the user to authenticate with the OAuth provider.

  6. The "identifier" returned by the OAuth provider is the OAuth identifier parameter that you will use for the X-FM-Data-OAuth-Identifier string in the header.

See "Editing OAuth account access" in FileMaker Pro Help.