FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Local oauth2/token endpoint returns missing grant_type error

    Scheduled Pinned Locked Moved
    General Discussion
    2
    3
    1.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      josh.dura
      last edited by

      I am getting the following error when trying to hit the /oauth2/token endpoint with the code given from the authorize redirect:

      {
            error: 'invalid_request',
            error_description: 'The request is missing a required parameter: grant_type',
            error_reason: 'missing_grant_type'
      }
      

      Below is the data I am passing through in the POST call (redacted secret of course):

      {
          "client_id":"<redacted>",
          "client_secret":"<redacted>",
          "code":"_IGmWdtvD400g5Gq9t8kkyMzgurk2YZJecB-Jf7XX1E",
          "grant_type":"authorization_code",
          "redirect_uri":"http://localhost:5173"
      }
      

      As far as I can tell, I am passing everything through correctly. I have tried enabling debug mode on the application in the local docker compose container, but I never see any event logs coming through. Any suggestions?

      joshuaJ 1 Reply Last reply Reply Quote 0
      • joshuaJ
        joshua @josh.dura
        last edited by

        Hi @josh-dura -

        Is this still an open issue for you? The event logs are stored in the DB, so you should be able to access them by navigating in the admin UI ( system > events log ) to get a better idea of what might be occurring.

        Thanks,
        Josh

        J 1 Reply Last reply Reply Quote 0
        • J
          josh.dura @joshua
          last edited by

          @joshua Nope, was able to figure it out. I was sending the request body in JSON format instead of form URL encoded. Sorry for the late response here!

          1 Reply Last reply Reply Quote 2
          • First post
            Last post