PHP code example of nicumicle / simple-jwt-login-client-php

1. Go to this page and download the library: Download nicumicle/simple-jwt-login-client-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nicumicle / simple-jwt-login-client-php example snippets


    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com');
    
    $result = $simpleJwtLogin->registerUser('[email protected]', 'My-password');
    
    //var_dump($result); 

    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    header('Location: ' . $simpleJwtLogin->getAutologinUrl('My JWT', 'AUTH CODE', 'https://test.com'));

    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->registerUser('[email protected]', 'password', 'AUTH CODE');

    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->deleteUser('Your JWT here', 'AUTH CODE');

    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->resetPassword('[email protected]', 'AUTH CODE');

    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->changePassword('[email protected]', 'new password', 'code', null, 'AUTH CODE');

    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->changePassword('[email protected]', 'new password', null, 'Your JWT here', 'AUTH CODE');

    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->authenticate('[email protected]', 'your password', 'AUTH CODE');

    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->refreshToken('your JWT here', 'AUTH CODE');

   $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->validateToken('your JWT here', 'AUTH CODE');

   $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1'); 
   $result = $simpleJwtLogin->revokeToken('your JWT here', 'AUTH CODE');