2017 © Pedro Peláez
 

symfony-bundle auth-bundle

Simple Google Account Authentication Symfony Bundle

image

playtini/auth-bundle

Simple Google Account Authentication Symfony Bundle

  • Friday, July 6, 2018
  • by luchaninov
  • Repository
  • 2 Watchers
  • 2 Stars
  • 117 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 14 % Grown

The README.md

Playtini Auth Bundle

Implementation of common authentication logic, (*1)

Installation

1) Use composer, (*2)

Add parameters to app/config/parameters.yml.dist, (*3)

parameters:
    google_app_id:     something.apps.googleusercontent.com
    google_app_secret: your_secret
    google_app_domain: yourdomain.com
    google_app_users: user1,user2

You may add parameters to env-map:, (*4)

"google_app_id": "GOOGLE_APP_ID",
"google_app_secret": "GOOGLE_APP_SECRET",
"google_app_domain": "GOOGLE_APP_DOMAIN",
"google_app_users": "GOOGLE_APP_USERS",

Install, (*5)

composer require playtini/auth-bundle

2) Add PlaytiniAuthBundle and KnpUOAuth2ClientBundle to app/AppKernel.php, (*6)

// app/AppKernel.php
new \KnpU\OAuth2ClientBundle\KnpUOAuth2ClientBundle(),
new \Playtini\Bundle\AuthBundle\PlaytiniAuthBundle()

3) Set app/config/security.yml, (*7)

security:
    encoders:
        Symfony\Component\Security\Core\User\User:
            algorithm: bcrypt

    # http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
    providers:
        database_users:
            entity: { class: 'Playtini\Bundle\AuthBundle\Entity\User', property: username }
        api_key_user_provider:
            id: playtini.auth.security.api_key_user_provider

    firewalls:
        dev:
            pattern:  ^/(_(profiler|wdt)|css|images|js)/
            security: false
        api:
            pattern: ^/api/(?!key\.json)
            stateless: true
            simple_preauth:
                authenticator: playtini.auth.security.api_key_authenticator
            provider: api_key_user_provider
        main:
            pattern: ^/
            logout:       true
            anonymous:    true
            guard:
                authenticators:
                    - playtini.auth.security.google_authenticator
                entry_point: playtini.auth.security.google_authenticator
            remember_me:
                secret: "%secret%"
                lifetime: 31536000 # 365 days in seconds
                path: /
                domain: ~ # Defaults to the current domain from $_SERVER
                #always_remember_me: true
    access_control:
        - { path: ^/login/, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/, roles: ROLE_USER }

4) Enable AuthBundle routing. Add to app/config/routing.yml, (*8)

playtini_auth:
    resource: "@PlaytiniAuthBundle/Resources/config/routing/routing.yml"

5) Update your database schema, (*9)

The Versions

06/07 2018

dev-master

9999999-dev

Simple Google Account Authentication Symfony Bundle

  Sources   Download

proprietary

The Requires

 

The Development Requires

by Andrew Shukailo

06/07 2018

0.1.6

0.1.6.0

Simple Google Account Authentication Symfony Bundle

  Sources   Download

proprietary

The Requires

 

The Development Requires

by Andrew Shukailo

06/07 2018

0.1.5

0.1.5.0

Simple Google Account Authentication Symfony Bundle

  Sources   Download

proprietary

The Requires

 

The Development Requires

by Andrew Shukailo

07/06 2017

0.1.4

0.1.4.0

Simple Google Account Authentication Symfony Bundle

  Sources   Download

proprietary

The Requires

 

The Development Requires

by Andrew Shukailo

11/04 2017

0.1.3

0.1.3.0

Simple Google Account Authentication Symfony Bundle

  Sources   Download

proprietary

The Requires

 

The Development Requires

by Andrew Shukailo

21/02 2017

0.1.2

0.1.2.0

Simple Google Account Authentication Symfony Bundle

  Sources   Download

proprietary

The Requires

 

The Development Requires

by Andrew Shukailo

21/02 2017

dev-fixes

dev-fixes

Simple Google Account Authentication Symfony Bundle

  Sources   Download

proprietary

The Requires

 

The Development Requires

by Andrew Shukailo

17/02 2017

0.1.1

0.1.1.0

Simple Google Account Authentication Symfony Bundle

  Sources   Download

proprietary

The Requires

 

The Development Requires

by Andrew Shukailo

16/01 2017

v0.1

0.1.0.0

Simple Google Account Authentication Symfony Bundle

  Sources   Download

proprietary

The Requires

 

The Development Requires

by Andrew Shukailo