Skip to content
Advertisement

Call AccessTokenController.issueToken() directly from Code

I am using Laravel Passport to secure my REST API. Currently I create Personal Access Tokens using $user->createToken('APP_NAME')->accessToken, but these have no expiration date. So I wanted to create a Password Access Token. I noticed, that these are generated by the AccessTokenController.issueToken() method.

But I could not find anything on how I can call it.


My current solution

JavaScript

Advertisement

Answer

I found a solution here:

JavaScript

I changed new CryptKey('file://' . Passport::keyPath('oauth-private.key')) to new CryptKey('file://' . Passport::keyPath('oauth-private.key'), null, false) to avoid a permissions not correct Error (fix from here)

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement