File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed 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 @@ -308,9 +308,12 @@ protected function registerJWTParser()
308308 protected function registerResourceServer ()
309309 {
310310 $ this ->app ->singleton (ResourceServer::class, function ($ container ) {
311+ $ AccessTokenRepository = $ container ->make (Bridge \AccessTokenRepository::class);
312+
311313 return new ResourceServer (
312- $ container ->make (Bridge \AccessTokenRepository::class),
313- $ this ->makeCryptKey ('public ' )
314+ $ AccessTokenRepository ,
315+ $ this ->makeCryptKey ('public ' ),
316+ new Passport::$ bearerTokenValidator ($ AccessTokenRepository )
314317 );
315318 });
316319 }
You can’t perform that action at this time.
0 commit comments