Showing results for 
Show  only  | Search instead for 
Did you mean: 
New Member

I cannot get a token.

I set up a new canvas server and use my old code which is workable to get a token.

However, I get following error.

{"error":"invalid_grant","error_description":"authorization_code not found"}

In the server-side, it shows

SQL DeveloperKey Load (1.4ms) SELECT "developer_keys"."id", "developer_keys"."api_key", "developer_keys"."email", "developer_keys"."user_name", "developer_keys"."account_id", "developer_keys"."created_at", "developer_keys"."updated_at", "developer_keys"."user_id", "developer_keys"."name", "developer_keys"."redirect_uri", "developer_keys"."icon_url", "developer_keys"."sns_arn", "developer_keys"."trusted", "developer_keys"."force_token_reuse", "developer_keys"."workflow_state", "developer_keys"."replace_tokens", "developer_keys"."auto_expire_tokens", "developer_keys"."redirect_uris", "developer_keys"."notes", "developer_keys"."access_token_count", "developer_keys"."vendor_code", "developer_keys"."visible", "developer_keys"."scopes", "developer_keys"."require_scopes", "developer_keys"."test_cluster_only", "developer_keys"."public_jwk", "developer_keys"."internal_service", "developer_keys"."oidc_initiation_url", "developer_keys"."public_jwk_url", "developer_keys"."is_lti_key" FROM "developer_keys" WHERE "developer_keys"."id" = 1 ORDER BY "developer_keys"."id" ASC LIMIT 1 [development:1 master]
Completed 400 Bad Request in 13ms (Views: 0.3ms | ActiveRecord: 1.4ms)

There is no 400 Bad Request when I login Postgres and execute the above SQL command.

Does anyone once have a similar problem?

2 Replies
Community Coach
Community Coach

Hello there,  @gary1111122222  Welcome to the Canvas Community.  Thank you for posting your question.  While I do not know how to answer your question, I wanted to let you know that I have shared your question with the Canvas Developers‌ group here in the Community in hopes that your question will get some additional exposure.  Since you are new to the Community, you may not be following that group as of yet.  Please click on the link I have provided, and then you'll see two buttons at the top right corner of the screen: "Follow" and "Actions".  Click on both of them.  When you click on "Actions", you'll need to further select "Join group".  I hope this will be of help to you, Gary.  Good luck!

Community Champion

Here's a case where another user was getting the same error last year: Incorrect Oauth2 Workflow after setting scope='/auth/userinfo' initially?