File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 22composer.lock
33/phpunit.xml
44.phpunit.result.cache
5+ .rnd
Original file line number Diff line number Diff line change @@ -86,6 +86,13 @@ class Passport
8686 */
8787 public static $ accessTokenEntity = 'Laravel\Passport\Bridge\AccessToken ' ;
8888
89+ /**
90+ * The bearer token validator class name.
91+ *
92+ * @var string
93+ */
94+ public static $ bearerTokenValidator = 'League\OAuth2\Server\AuthorizationValidators\BearerTokenValidator ' ;
95+
8996 /**
9097 * The auth code model class name.
9198 *
@@ -450,6 +457,17 @@ public static function useAccessTokenEntity($accessTokenEntity)
450457 static ::$ accessTokenEntity = $ accessTokenEntity ;
451458 }
452459
460+ /**
461+ * Set the custom bearer token validator class name.
462+ *
463+ * @param string $bearerTokenValidator
464+ * @return void
465+ */
466+ public static function useBearerTokenValidator ($ bearerTokenValidator )
467+ {
468+ static ::$ bearerTokenValidator = $ bearerTokenValidator ;
469+ }
470+
453471 /**
454472 * Set the auth code model class name.
455473 *
Original file line number Diff line number Diff line change @@ -310,7 +310,8 @@ protected function registerResourceServer()
310310 $ this ->app ->singleton (ResourceServer::class, function ($ container ) {
311311 return new ResourceServer (
312312 $ container ->make (Bridge \AccessTokenRepository::class),
313- $ this ->makeCryptKey ('public ' )
313+ $ this ->makeCryptKey ('public ' ),
314+ new Passport::$ bearerTokenValidator ($ container ->make (Bridge \AccessTokenRepository::class))
314315 );
315316 });
316317 }
You can’t perform that action at this time.
0 commit comments