This is Auth0 authentication extension for Nette framework.
It integrates Auth0 PHP SDK.
Download extension using Composer.
composer require somemove/auth0-nette-extension
extensions:
auth0: \Somemove\Auth0NetteExtesion\DI\Auth0NetteExtesion
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_userpersist_access_tokenpersist_refresh_tokenpersist_id_tokenstorestate_handlerdebug
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.
class YourPresenter extends Presenter {
/**
* @var \Auth0\SDK\Auth0 @inject
*/
public $auth0;
public function actionLogin() {
$this->auth0->login();
}
}