2017 © Pedro Peláez
 

library auth

.

image

almajal/auth

.

  • Monday, April 2, 2018
  • by ejasoft
  • Repository
  • 0 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PHP cognito 0AUTH 2

Requirements

The following versions of PHP are supported:, (*1)

  • PHP 5.6
  • PHP 7.1
  • PHP 7.2

Installation

composer require almajal/auth

how to use

error_reporting(E_ALL);
ini_set('display_errors', 'On');

require 'vendor/autoload.php';

use Almajal\Auth\CognitoAuth;

// TESTING 
CognitoAuth::config([
        'endPoint'      => 'https://yourdomain.auth.eu-central-1.amazoncognito.com/',
        'clientId'      => 'your client id',
        'clientSecret'  => 'your client secret',
        'redirectUri'   => 'https://test.localhost/',
    ]);



if  ( isset ( $_GET['code'] ) ){

    try {

        $getIdToken = CognitoAuth::getInstance()->getTokensByCode($_GET['code'])->getIdToken(true);
        PRINT ( $getIdToken );
        // do your stuff here 

    }
    catch (exception $e)
    { 
        echo $e->getMessage();
     }
}
else{

    echo '<a href="' . CognitoAuth::MakeLoginUrl('testing') . '"">login via almajal id</a>';
}


The Versions

02/04 2018

dev-master

9999999-dev https://github.com/nilesolutions

.

  Sources   Download

proprietary

The Requires

 

The Development Requires

by Ahmed Sami

coginto 0auth 0auth 2