Componette

Componette

download-cloud-line composer require somemove/auth0-nette-extension

Latest Stable Version Total Downloads License

Auth0 Nette Extension

This is Auth0 authentication extension for Nette framework.

It integrates Auth0 PHP SDK.

Installation

Download extension using Composer.

composer require somemove/auth0-nette-extension
extensions:
	auth0: \Somemove\Auth0NetteExtesion\DI\Auth0NetteExtesion

Configuration

Configure extension in your config.neon file:

auth0:
	'domain' : 'your.auth0.com'
	'audience' : 'https://audience.url'
	'scope' : 'openid profile offline_access'
	'client_id' : '{CLIENT_ID}'
	'client_secret' : '{CLIENT_SECRET}'
	'redirect_uri' : 'https://your.callback'

Following properties have defaults values in the extension and can be ommited in your configuration:

  • persist_user
  • persist_access_token
  • persist_refresh_token
  • persist_id_token
  • store
  • state_handler
  • debug

In order to disable persistence of user, or tokens into Nette session object, either set store to FALSE for global setting or respective attribute to FALSE.

Usage

class YourPresenter extends Presenter {

	/**
	 * @var \Auth0\SDK\Auth0 @inject
	 */
	public $auth0;

	public function actionLogin() {
		$this->auth0->login();
	}

}
  • 1.3.0 1.3.0

    • BC: Nette DI version upgraded to 3.0
    • BC: Auth0 PHP upgraded to 5.5
  • 1.2.0 1.2.0

    • PHP 7.2 now required as minimal version
    • Auth0 PHP version upgraded to 5.3+
  • 1.1.2.1 1.1.2.1

    • MIT licence assigned to the project.
  • 1.1.2 1.1.2

    • FIX: Auth0 store value getter ignored the default value getter.
  • 1.1.1 1.1.1

    • FIX: Could not call $auth->login() as the state handler was enabled by mistake.
  • 1.1.0 1.1.0

    • Nette Session used to store user and tokens upon from Auth0 object. StoreInterface implementation uses Nette\Http\Session only when is started.
  • 1.0.0 1.0.0

    Initial extension version that creates an Auth0 service using given configuration and defined defaults.

bar-chart-fill

Statistics

download-cloud-fill
60
star-fill
2
bug-fill
1
flashlight-fill
132d
price-tag-2-line

Badges

guide-fill

Dependencies

php (^7.2)
nette/di (^3.0)
Componette Componette felix@nette.org