AnsweredAssumed Answered

OAuth2 Authentication Request: "Route [login] not defined"?

Question asked by Lee Newton on Nov 8, 2019
Latest reply on Nov 8, 2019 by Lee Newton


I'm developing a software that uses OAuth2 authentication with Canvas. It's to authenticate users, admins and non-users and see if they've permission to access a page. To that end, I'm following the documentation here:


Per its instruction, I'm trying to GET from an endpoint, so my route is calling a request on:

GET https://<canvas-install-url>/login/oauth2/auth?client_id=XXX&response_type=code&redirect_uri=<value_1>%20<value_2>%20<value_n>

Which I've shortened down to this:

However, when I try to make a request on this route, I get the following error message:

Symfony\Component\Routing\Exception\RouteNotFoundException: Route [login] not defined.

It seems it doesn't like the "login" part? I don't understand why. Could anyone please offer some clarity on the subject? I'd be most grateful.


If it's of any use, here is my code in laravel for the route request:


Route::get('/testClient', ['as' => 'testClient', 'uses' => function(Request $request) {
   $http = new GuzzleHttp\Client;
   $response = $http->post('', [
      'form_params' => [
         'grant_type' => 'authorization_code',
         'client_id' => my_id,
         'client_secret' => 'my_secret',
         'redirect_uri' => '',

   return json_decode((string) $response->getBody(), true)['access_token'];


EDIT: This was an error on Laravel's end, not on Canvas'. It was because my middleware routes in there were not configured correctly. This problem for me has now been solved.