matatirosoln / fm-cloud-authentication
Authenticate against FileMaker cloud for Data API or Admin API access
Installs: 1 161
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 4
Open Issues: 1
Requires
- php: 7.4.*||8.0.*||8.1.*||8.2.*
- aws/aws-sdk-php: ^3.198
- guzzlehttp/guzzle: ^7.3
- nesbot/carbon: ^3.0
- phpseclib/phpseclib: ^3.0
Requires (Dev)
- phpunit/phpunit: ^9.5
README
The FileMaker Data API uses a realtively simple authentication pattern when using a self hosted server. Post valid credentials to the server, receive a token, use that as a bearer token for subsequent requests.
With FileMaker Cloud 2 however, the process is made somewhat more complex through the use of Cognito, the AWS credentials management system. This library simplifies that process to be as straight-forward as the on-premise version.
Installation
composer require matatirosoln/fm-cloud-authentication
Usage
$credentials = new \MSDev\FMCloudAuthenticator\Credentials( 'your-fm-cloud-server', 'your-fmrest-user', 'your-fmrest-password', \MSDev\FMCloudAuthenticator\Credentials::DAPI, 'your-database' ); $authenticator = new \MSDev\FMCloudAuthenticator\Authenticate(); $token = $authenticator->fetchToken($credentials);
$token
should now contain a bearer token which you can use for subsequent requests as usual.
At present only the Data API is supported, however we plan to extend this to the Admin API as well.
Contact
See this blog post for more details.
Steve Winter
Matatiro Solutions
steve@msdev.co.uk