Fixed booting sequence for ClientAuthContextValidatorFactoryProvider

bc was failing to get the current route for token endpoint

Change-Id: Ia5a0b253e9b33c1d5888c8d7e7ec434a1b1ffb76
This commit is contained in:
smarcet 2019-01-30 01:42:16 -03:00
parent cb3fee441f
commit f5d5d08494
1 changed files with 12 additions and 8 deletions

View File

@ -26,15 +26,19 @@ final class ClientAuthContextValidatorFactoryProvider extends ServiceProvider
public function boot()
{
ClientAuthContextValidatorFactory::setTokenEndpointUrl
(
URL::action('OAuth2\OAuth2ProviderController@token')
);
// wait till app is fully booted so we have access to routes
$this->app->booted(function () {
ClientAuthContextValidatorFactory::setTokenEndpointUrl
(
URL::action('OAuth2\OAuth2ProviderController@token')
);
ClientAuthContextValidatorFactory::setJWKSetReader
(
App::make(\OAuth2\Services\IClientJWKSetReader::class)
);
});
ClientAuthContextValidatorFactory::setJWKSetReader
(
App::make(\OAuth2\Services\IClientJWKSetReader::class)
);
}
/**
* Register the service provider.