2017 © Pedro Peláez
 

symfony-bundle grand-id-bundle

Symfony bundle to use Grand ID service https://www.grandid.com/

image

bsadnu/grand-id-bundle

Symfony bundle to use Grand ID service https://www.grandid.com/

  • Wednesday, June 20, 2018
  • by bsadnu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 349 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 256 % Grown

The README.md

Grand ID Symfony Bundle

Latest Stable Version Total Downloads License, (*1)

This extension provides a number of service methods necessary for working with Grand ID API. All sessions data are stored in database., (*2)

There are so-called mock system which is helpful for testing purposes. Mock-methods do not call any Grand ID API endpoints. They just simulate sessions: create, store & update them in DB table., (*3)

Installation

Applications that use Symfony Flex

Open a command console, enter your project directory and execute:, (*4)

$ composer require bsadnu/grand-id-bundle

Applications that don't use Symfony Flex

Step 1: Download the Bundle, (*5)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:, (*6)

$ composer require bsadnu/grand-id-bundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*7)

Step 2: Enable the Bundle, (*8)

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:, (*9)

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Bsadnu\GrandIDBundle\GrandIDBundle(),
        );

        // ...
    }

    // ...
}

Configuration

Add the config/packages/grand_id.yaml file consists of settings as follows:, (*10)

grand_id:
    base_url: '%env(GRAND_ID_BASE_URL)%' #(e.g. https://client-test.grandid.com/json1.1/)
    api_key: '%env(GRAND_ID_API_KEY)%'
    authenticate_service_key: '%env(GRAND_ID_AUTH_SERVICE_KEY)%'

Perform bin/console doctrine:migrations:diff and bin/console doctrine:migrations:migrate commands in order to create Grand ID sessions DB table., (*11)

Usage

Somewhere in your controller:, (*12)

<?php

...

use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

...

class SomeController extends Controller
{
    ...

    private $bankIdProvider;

    public function __construct(ContainerInterface $container)
    {
        $this->bankIdProvider = $container->get('bsadnu.grand_id');
    }

    public function doSomething()
    {
        ...

        $callBackUrl = 'https://domain.com/my/action'

        $loginObject = $this->bankIdProvider->federatedLogin($callBackUrl);

        ...
    }   

    ...
}

Available methods

  • federatedLogin(string $callbackUrl) - performs real FederatedLogin API call. Store real session params.
  • federatedLoginMock(string $callbackUrl, string $host, string $protocol) - does not perform any API call. Just store mock session params.
  • federatedDirectLogin(string $username, string $password)- performs real FederatedDirectLogin API call. Store real session params.
  • logout(string $sessionId) - performs real API Logout. Update related DB record.
  • logoutMock(string $sessionId) - does not perform any API call. Just update certain DB record.
  • getSession(string $sessionId) - fetch session params by calling real API GetSession.
  • getSessionMock(string $sessionId) - fetch mock session params by from DB.
  • enableMockSession(string $sessionId, string $username) - update mock session DB record by adding username and making is_logged_in equals to true.

Acknowledgments

The Versions

20/06 2018

dev-master

9999999-dev

Symfony bundle to use Grand ID service https://www.grandid.com/

  Sources   Download

MIT

The Requires

 

by Stas Bannikov

symfony grand id

20/06 2018

v0.1.9

0.1.9.0

Symfony bundle to use Grand ID service https://www.grandid.com/

  Sources   Download

MIT

The Requires

 

by Stas Bannikov

symfony grand id

12/06 2018

v0.1.8

0.1.8.0

Symfony bundle to use Grand ID service https://www.grandid.com/

  Sources   Download

MIT

The Requires

 

by Stas Bannikov

symfony grand id

08/05 2018

v0.1.7

0.1.7.0

Symfony bundle to use Grand ID service https://www.grandid.com/

  Sources   Download

MIT

The Requires

 

by Stas Bannikov

symfony grand id

08/05 2018

v0.1.6

0.1.6.0

Symfony bundle to use Grand ID service https://www.grandid.com/

  Sources   Download

MIT

The Requires

 

by Stas Bannikov

symfony grand id

08/05 2018

dev-service_updates

dev-service_updates

Symfony bundle to use Grand ID service https://www.grandid.com/

  Sources   Download

MIT

The Requires

 

by Stas Bannikov

symfony grand id

07/05 2018

v0.1.5

0.1.5.0

Symfony bundle to use Grand ID service https://www.grandid.com/

  Sources   Download

MIT

The Requires

 

by Stas Bannikov

symfony grand id

03/05 2018

v0.1.4

0.1.4.0

Symfony bundle to use Grand ID service https://www.grandid.com/

  Sources   Download

MIT

The Requires

 

by Stas Bannikov

symfony grand id

02/05 2018

v0.1.3

0.1.3.0

Symfony bundle to use Grand ID service https://www.grandid.com/

  Sources   Download

MIT

The Requires

 

by Stas Bannikov

symfony grand id

02/05 2018

v0.1.2

0.1.2.0

Symfony bundle to use Grand ID service https://www.grandid.com/

  Sources   Download

MIT

The Requires

 

by Stas Bannikov

symfony grand id

02/05 2018

v0.1.1

0.1.1.0

Symfony bundle to use Grand ID service https://www.grandid.com/

  Sources   Download

MIT

The Requires

 

by Stas Bannikov

symfony grand id

26/04 2018

0.2

0.2.0.0

Symfony bundle to use Grand ID service https://www.grandid.com/

  Sources   Download

MIT

The Requires

 

by Stas Bannikov

symfony grand id

26/04 2018

dev-config_fix

dev-config_fix

Symfony bundle to use Grand ID service https://www.grandid.com/

  Sources   Download

MIT

The Requires

 

by Stas Bannikov

symfony grand id

25/04 2018

0.1

0.1.0.0

Symfony bundle to use Grand ID service https://www.grandid.com/

  Sources   Download

MIT

The Requires

 

by Stas Bannikov

symfony grand id