cryptr / cryptr-php
Cryptr Package to handle Cryptr authentication processes
0.0.1
2023-01-09 15:27 UTC
Requires
- php: >=7.0
- firebase/php-jwt: ^6.3
Requires (Dev)
- phpunit/php-code-coverage: ^9.2
- phpunit/phpunit: ^9.5
- symfony/var-dumper: ^6.2
This package is not auto-updated.
Last update: 2024-04-30 21:04:29 UTC
README
PHP SDK for Cryptr Authentication processes
Learn more on our online Documentation 📚.
Installation
Requirements
- PHP 7.3+
Installation
Use the following composer command to install our SDK
composer require cryptr/cryptr-php
This SDK is mainly focused on PHP API applications, securing your endpoints.
here is how you can use it
<?php require Cryptr\Cryptr; $yourFetchedTokenFromAuthHeader = 'ey....'; $cryptrBaseUrl = "https://your-company.authent.me"; $allowedOrigins = ["https://www.your-company.com"]; $cryptr = new Cryptr($cryptrBaseUrl, $allowedOrigins); $cryptr->validateToken($yourFetchedTokenFromAuthHeader) // -> returns true or throw according error // Be aware that we look for $_ENV['CRYPTR_BASE_URL'] and $_ENV['CRYPTR_ALLOWED_ORIGINS'] // Like that you can just call $cryptr = new Cryptr();