lundi 27 avril 2020

Create New Passport Client for a User in Laravel and Passport inside Controller

Is there a way to create passport client in Laravel. For example, to create a Token, we can do:

$user = $request->user();
$token = $user->createToken("myApp")->accessToken;

Do we something for Client too?

$user = $request->user();
$token = $user->createClient("myApp")->accessClient;

I checked the documentation and it is possible to create a client using an API, but the example is in Vue.JS

const data = {
    name: 'Client Name',
    redirect: 'http://example.com/callback'
};

axios.post('/oauth/clients', data)
.then(response => {
    console.log(response.data);
})
.catch (response => {
    // List errors on response...
});

But I am unable to run this example in POSTMAN... I am not sure which function or method is being triggered for above API Call. How can I make use of this POST method outside VueJS.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3eVfQYv
via IFTTT

Aucun commentaire:

Enregistrer un commentaire