2017 © Pedro Peláez
 

symfony-bundle apiauthbundle

Authorization for token for REST application.

image

coresite/apiauthbundle

Authorization for token for REST application.

  • Monday, April 3, 2017
  • by CoreSite
  • Repository
  • 2 Watchers
  • 0 Stars
  • 131 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

APIAuthBundle

Авторизация по токену, для REST приложений., (*1)

Установка и подключение

Установка:

$ composer require coresite/apiauthbundle

Подключение:

// app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new CoreSite\APIAuthBundle\CoreSiteAPIAuthBundle(),
            // ...
        );

        // ...
    }
}   

Настройка:

Пример настройки, вам скорее всего придется производить настройку под свою конфигурацию., (*2)

// app/security.yml
firewalls:

    # ...

    api:
        pattern: ^/api
        stateless: true
        simple_preauth:
            authenticator: cs_apiauth_authenticator
            provider: cs_apiauth_user_provider

    api_login:
        provider: fos_userbundle
        stateless: true
        anonymous: ~
        cs_apiauth_login:
            check_path:               api_login_check
            username_parameter:       _username
            password_parameter:       _password
            success_handler:          cs_apiauth_user_handler_authentication_success
            failure_handler:          cs_apiauth_user_handler_authentication_failure
            require_previous_session: false
        logout:
            success_handler:          cs_apiauth_user_handler_logout

    # ...

    providers:
        fos_userbundle:
            id: fos_user.user_provider.username
        cs_apiauth_user_provider:
            id: cs_apiauth_user_provider

        access_control:
            - { path: ^/api, role: IS_AUTHENTICATED_FULLY }
            - { path: ^/login_check, roles: IS_AUTHENTICATED_ANONYMOUSLY }     

    # ...                   

Создание таблицы для хранение токенов:

    # php bin/console doctrine:schema:update --force 

Отказ от отвестовенности

Обратите внимание, что данный бандел разработан для личных нужд и не является до конца доработанным проектом, его использование не рекомендуется промышленных целей. Автор не несет ни какой ответственности за проблемы которые могут возникнут при использования данного кода., (*3)

The Versions

03/04 2017

dev-master

9999999-dev https://github.com/CoreSite/CoreBundle

Authorization for token for REST application.

  Sources   Download

MIT

The Requires

 

by Dmitriy Shuba

api auth rest

24/02 2017
18/01 2017
17/01 2017

0.3.0

0.3.0.0 https://github.com/CoreSite/CoreBundle

Authorization for token for REST application.

  Sources   Download

MIT

The Requires

 

by Dmitriy Shuba

api auth rest

12/01 2017

0.2.0

0.2.0.0 https://github.com/CoreSite/CoreBundle

Authorization for token for REST application.

  Sources   Download

MIT

The Requires

 

by Dmitriy Shuba

api auth rest

13/12 2016

0.1.8

0.1.8.0 https://github.com/CoreSite/CoreBundle

Authorization for token for REST application.

  Sources   Download

MIT

The Requires

 

by Dmitriy Shuba

api auth rest

13/12 2016

0.1.7

0.1.7.0 https://github.com/CoreSite/CoreBundle

Authorization for token for REST application.

  Sources   Download

MIT

The Requires

 

by Dmitriy Shuba

api auth rest

13/12 2016

0.1.6

0.1.6.0 https://github.com/CoreSite/CoreBundle

Authorization for token for REST application.

  Sources   Download

MIT

The Requires

 

by Dmitriy Shuba

api auth rest

13/12 2016

0.1.5

0.1.5.0 https://github.com/CoreSite/CoreBundle

Authorization for token for REST application.

  Sources   Download

MIT

The Requires

 

by Dmitriy Shuba

api auth rest

13/12 2016

0.1.4

0.1.4.0 https://github.com/CoreSite/CoreBundle

Authorization for token for REST application.

  Sources   Download

MIT

The Requires

 

by Dmitriy Shuba

api auth rest

12/12 2016

0.1.3

0.1.3.0 https://github.com/CoreSite/CoreBundle

Authorization for token for REST application.

  Sources   Download

MIT

The Requires

 

by Dmitriy Shuba

api auth rest

19/08 2016

0.1.2

0.1.2.0 https://github.com/CoreSite/CoreBundle

Authorization for token for REST application.

  Sources   Download

MIT

The Requires

 

by Dmitriy Shuba

api auth rest

19/08 2016

0.1.1

0.1.1.0 https://github.com/CoreSite/CoreBundle

Authorization for token for REST application.

  Sources   Download

MIT

The Requires

 

by Dmitriy Shuba

api auth rest

17/06 2016

0.1.0

0.1.0.0 https://github.com/CoreSite/CoreBundle

Authorization for token for REST application.

  Sources   Download

MIT

The Requires

 

by Dmitriy Shuba

api auth rest