Issuing Access Tokens: Managing Clients

This consists of providing the name of their application and a URL that your application can redirect to after users approve their request for authorization.

The passport:client Command

May be used to create your own clients for testing your OAuth2 functionality.

Php artisan passport:client

Redirect URLs

Http://example.com/callback,http://examplefoo.com/callback

GET /oauth/clients

Returns all of the clients for the authenticated user.

Axios.get('/oauth/clients')
    .then(response => {
        console.log(response.data);
    });

POST /oauth/clients

Is used to create new clients.

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...
    });

PUT /oauth/clients/{client-id}

Is used to update clients.

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

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

DELETE /oauth/clients/{client-id}

Axios.delete('/oauth/clients/' + clientId)
    .then(response => {
        //
    });

Issuing Access Tokens: Managing Clients — Structure map

Clickable & Draggable!

Issuing Access Tokens: Managing Clients — Related pages: