matatirosoln / fm-cloud-authentication
用于通过FileMaker云服务进行数据API或管理API访问的认证
0.3.0
2024-03-24 22:00 UTC
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
当使用自托管服务器时,FileMaker数据API使用相对简单的认证模式。将有效的凭证发送到服务器,接收一个令牌,然后将其作为随后的请求的承载令牌使用。
然而,FileMaker Cloud 2通过使用Cognito(AWS凭证管理系统)使这个过程变得稍微复杂一些。这个库简化了这个过程,使其与本地版本一样简单直接。
安装
composer require matatirosoln/fm-cloud-authentication
使用
$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
现在应包含一个承载令牌,您可以使用它像往常一样进行后续请求。
目前只支持数据API,但我们计划也将此扩展到管理API。
联系方式
请参阅这篇博客文章获取更多详细信息。
Steve Winter
Matatiro Solutions
steve@msdev.co.uk