Laravel's 5.3 passport and api routes : <p>I'm using Laravel Framework version 5.3.9, fresh download nothing added on via composer(except <code>"laravel/passport": "^1.0"</code>).</p>

<p>I did all the things suggested in the <a href="https://laravel.com/docs/master/passport">docs</a>. Tables are created, routes are up, everything works fine. However I need passport for an API.</p>

<p>My routes look like so:</p>

<pre><code>+--------+----------+-----------------------------------------+----------------------+----------------------------------------------------------------------------+------------+
| Domain | Method   | URI                                     | Name                 | Action                                                                     | Middleware |
+--------+----------+-----------------------------------------+----------------------+----------------------------------------------------------------------------+------------+
|        | GET|HEAD | /                                       |                      | Closure                                                                    | web        |
|        | GET|HEAD | api/v1/users/register                   | api::users::register | App\Http\Controllers\Api\V1\SocialController@register                      | api,auth   |
|        | POST     | oauth/authorize                         |                      | \Laravel\Passport\Http\Controllers\ApproveAuthorizationController@approve  | web,auth   |
|        | GET|HEAD | oauth/authorize                         |                      | \Laravel\Passport\Http\Controllers\AuthorizationController@authorize       | web,auth   |
|        | DELETE   | oauth/authorize                         |                      | \Laravel\Passport\Http\Controllers\DenyAuthorizationController@deny        | web,auth   |
|        | GET|HEAD | oauth/clients                           |                      | \Laravel\Passport\Http\Controllers\ClientController@forUser                | web,auth   |
|        | POST     | oauth/clients                           |                      | \Laravel\Passport\Http\Controllers\ClientController@store                  | web,auth   |
|        | PUT      | oauth/clients/{client_id}               |                      | \Laravel\Passport\Http\Controllers\ClientController@update                 | web,auth   |
|        | DELETE   | oauth/clients/{client_id}               |                      | \Laravel\Passport\Http\Controllers\ClientController@destroy                | web,auth   |
|        | GET|HEAD | oauth/personal-access-tokens            |                      | \Laravel\Passport\Http\Controllers\PersonalAccessTokenController@forUser   | web,auth   |
|        | POST     | oauth/personal-access-tokens            |                      | \Laravel\Passport\Http\Controllers\PersonalAccessTokenController@store     | web,auth   |
|        | DELETE   | oauth/personal-access-tokens/{token_id} |                      | \Laravel\Passport\Http\Controllers\PersonalAccessTokenController@destroy   | web,auth   |
|        | GET|HEAD | oauth/scopes                            |                      | \Laravel\Passport\Http\Controllers\ScopeController@all                     | web,auth   |
|        | POST     | oauth/token                             |                      | \Laravel\Passport\Http\Controllers\AccessTokenController@issueToken        |            |
|        | POST     | oauth/token/refresh                     |                      | \Laravel\Passport\Http\Controllers\TransientTokenController@refresh        | web,auth   |
|        | GET|HEAD | oauth/tokens                            |                      | \Laravel\Passport\Http\Controllers\AuthorizedAccessTokenController@forUser | web,auth   |
|        | DELETE   | oauth/tokens/{token_id}                 |                      | \Laravel\Passport\Http\Controllers\AuthorizedAccessTokenController@destroy | web,auth   |
+--------+----------+-----------------------------------------+----------------------+----------------------------------------------------------------------------+------------+
</code></pre>

<p>All the <code>web</code> routes are there, there are no <code>api</code> related routes, since Passport doesn't provide anything of that sort out of the box.</p>

<p>The API itself is intended to be used by a trusted client, it's made for a mobile application that does require a login however, said login will bypass a few steps. </p>

<p>Once a user access the <code>/register</code> route, the registration process itself is quite simple: access the user's facebook account an grab a few fields - email, facebook id, name an profile picture and from that point onwards the users is considered registered. But the user will <strong>NOT</strong> login with facebook(this is a very important aspect). The consumer app will be issued a token and use that token to access various endpoints of the api(that require a token to use). </p>

<p>So it boils down to this. I need to issue an access token to the consumer app that access the API. The API itself will only have one client, that is the mobile app itself. Users that use the app are not considered clients of the API but clients of the mobile app itself.</p>

<p>So far Passport is a headache to work with when it comes to implementing API related stuff, either that or I can't figure out how to make it work properly.</p>

<p>I've created a test client in the <code>oauth_clients</code> table that looks like so:</p>

<p><a href="https://i.stack.imgur.com/4hYJh.png"><img src="https://i.stack.imgur.com/4hYJh.png" alt="enter image description here"></a></p>

<p>I'm using Postman to access <code>api/v1/users/register</code> route that has the <code>auth</code> middleware with the following <code>JSON application/json</code></p>

<pre><code>{
    "grant_type" : "authorization_code",
    "client_id" : 5,
    "client_secet": "y5dvPIOxQJOjYn7w2zzg4c6TRrphsrNFWbG4gAUL"
}
</code></pre>

<p>Which of course will result in a </p>

<pre><code>{"error":"Unauthenticated."}
</code></pre>

<p>It makes perfect sense.
Out of pure curiosity I changed the <code>/register</code> route to this:</p>

<pre><code>Route::group([
    'middleware' =&gt; [
    ],
], function ()
{
    Route::group([
        'prefix' =&gt; 'users',
        'as'     =&gt; 'users::',
    ], function ()
    {
//        Route::get('/register', ['as'   =&gt; 'register', 'uses' =&gt; 'Api\V1\SocialController@register',]);
        Route::post('/register', ['as'   =&gt; 'register', 'uses' =&gt; '\Laravel\Passport\Http\Controllers\AccessTokenController@issueToken',]);
    });

});
</code></pre>

<p>With the same <code>json</code> as before. That resulted in <code>{"error":"invalid_client","message":"Client authentication failed"}</code>. </p>

<p>I've tracked down the function that, I think, handles the <code>validateClient</code> part in <a href="https://github.com/thephpleague/oauth2-server/blob/master/src/Grant/AbstractGrant.php#L143"><code>vendor/league</code>oauth2-server/src/Grant/AbstractGrant`</a>.</p>

<p>The <code>$client</code> is null. Now this may or may not be related to Passport, since the documentation on it rather lacking and the thought of digging thru a monster of a package to track down the error that may be largely due to me not doing something right doesn't strike me as a good idea, I'm out of options. To be perfectly honest I don't even know what the problem is.</p>

<p>Really, at this point any sort pointing in the right direction is more than welcome.</p>

<p>The part in questions is </p>
