Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

cryptr-auth/cryptr-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cryptr-PHP

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();