Created
December 29, 2021 23:40
-
-
Save kmuenkel/3286e18c6417eb2c23d030c337b267c0 to your computer and use it in GitHub Desktop.
Create OAuth Bearer token for testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$this->client = app(ClientRepository::class)->create(null, $clientName, ''); | |
$response = $this->post(route('passport.token'), [ | |
'grant_type' => 'client_credentials', | |
'client_id' => $this->client->getKey(), | |
'client_secret' => $this->client->plainSecret, | |
'scope' => implode(' ', $scopes) | |
]); | |
$this->token = $response->json('token_type').' '.$response->json('access_token'); | |
//Passport::actingAsClient($this->client, AccountScopes::keys()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment