2017 © Pedro Peláez
 

library nette-opauth

Opauth extension for Nette framework

image

michalsvec/nette-opauth

Opauth extension for Nette framework

  • Wednesday, September 30, 2015
  • by michalsvec
  • Repository
  • 7 Watchers
  • 23 Stars
  • 3,263 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 3 Open issues
  • 17 Versions
  • 4 % Grown

The README.md

michalsvec/nette-opauth

Requirements

As it's an Opauth extension for Nette framework, it requires, (*1)

Installation

Update composer.json:, (*2)

"require": {
    "michalsvec/nette-opauth": "*"
}

and then, (*3)

$ composer install

Update bootstrap.php:, (*4)

// add compiler extension
$configurator->onCompile[] = function (\Nette\Config\Configurator $config, \Nette\Config\Compiler $compiler) {
    $compiler->addExtension('opauth', new NetteOpauth\DI\Extension());
};

// register routers
\NetteOpauth\NetteOpauth::register($container->router);

Check if routes are in proper order (auth routes before the commons). And update Auth presenter as shown in example., (*5)

Then you can use:, (*6)

{if Nette\Config\Configurator::detectDebugMode()}
    <a href="{plink Auth:callback, strategy => 'fake'}">Fake login</a><br/>
{/if}
<a href="{plink Auth:google}">Sign-in with Google</a><br/>
<a href="{plink Auth:facebook}">Sign-in with Facebook</a><br/>
<a href="{plink Auth:twitter}">Sign-in with Twitter</a><br/>
<a href="{plink Auth:linkedin}">Sign-in with LinkedIn</a><br/>

Configure in config.neon

opauth:
    path: '/auth/'
    debug: false
    callback_url: '{path}callback'
    security_salt: '123abc456def'
    callback_transport: 'session'
    Strategy:
        Facebook:
            app_id: ''
            app_secret: ''
        Google:
            client_id: ''
            client_secret: ''
        Twitter:
            key: ''
            secret: ''
        LinkedIn:
            api_key: ''
            secret_key: ''

Tips and triks

  • opauth needs public callback url to proper redirect thus is impossible to use it at localhost (except the fake login).
  • facebook
    • registration of app
  • google
    • registration of app
    • google ids are very long (more than unsigned int) be careful about that
  • twitter
    • registration of app
    • do not provide email
  • linkedin
    • registration of app
    • provide OAuth 2.0 Redirect URLs in app registration: http://yourdomain.tld/auth/linkedin/oauth2callback
    • to obtain email, include r_emailaddress to scope, eg.: 'scope' => 'r_basicprofile r_emailaddress'.

Roadmap

  • [ ] add more identities for various providers

The Versions

30/09 2015

dev-master

9999999-dev

Opauth extension for Nette framework

  Sources   Download

MIT

The Requires

 

opauth nette

30/09 2015
15/08 2014
09/05 2014
15/02 2014

v0.6.4

0.6.4.0

Opauth extension for Nette framework

  Sources   Download

MIT

The Requires

 

opauth nette

14/02 2014

v0.6.3

0.6.3.0

Opauth extension for Nette framework

  Sources   Download

MIT

The Requires

 

opauth nette

09/02 2014

v0.6.2

0.6.2.0

Opauth extension for Nette framework

  Sources   Download

MIT

The Requires

 

opauth nette

07/02 2014

v0.6.1

0.6.1.0

Opauth extension for Nette framework

  Sources   Download

MIT

The Requires

 

opauth nette

07/02 2014

v0.6.0

0.6.0.0

Opauth extension for Nette framework

  Sources   Download

MIT

The Requires

 

opauth nette

18/08 2013

v0.5.1

0.5.1.0

Opauth extension for Nette framework

  Sources   Download

MIT

The Requires

 

opauth nette

22/07 2013

v0.5

0.5.0.0

Opauth extension for Nette framework

  Sources   Download

MIT

The Requires

 

opauth nette

21/06 2013

v0.4.2

0.4.2.0

Opauth extension for Nette framework

  Sources   Download

MIT

The Requires

 

opauth nette

17/06 2013

v0.4.1

0.4.1.0

Opauth extension for Nette framework

  Sources   Download

MIT

The Requires

 

opauth nette

17/06 2013

v0.4

0.4.0.0

Opauth extension for Nette framework

  Sources   Download

MIT

The Requires

 

opauth nette

16/06 2013

v0.3

0.3.0.0

Opauth extension for Nette framework

  Sources   Download

MIT

The Requires

 

opauth nette

11/06 2013

v0.1.1

0.1.1.0

Opauth extension for Nette framework

  Sources   Download

MIT

The Requires

 

opauth nette

11/06 2013

v0.1

0.1.0.0

Opauth extension for Nette framework

  Sources   Download

MIT

The Requires

 

opauth nette