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

    Error 404 when trying to login using access token

    Scheduled Pinned Locked Moved Unsolved
    Q&A
    token php login-api
    2
    2
    2.1k
    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.
    • S
      seednextsrl
      last edited by

      Hello everyone,

      I'm new to fusionAuth and I've just implemented a standard login into my PHP app using username and password.

      I receive a correct success response with a token on top, which I store in the user's session, but if I try to call the login api using the token instead of the password, as explained here, I get a 404 error response:

      FusionAuth\ClientResponse Object
      (
          [errorResponse] => 
          [exception] => 
          [method] => POST
          [request] => Array
              (
                  [applicationId] => app_id
                  [loginId] => username
                  [password] => very_long_access_token
                  [ipAddress] => 93.147.229.20
              )
      
          [successResponse] => 
          [status] => 404
      )
      

      Any idea on a possible cause for this error?

      Thank you!

      danD 1 Reply Last reply Reply Quote 0
      • danD
        dan @seednextsrl
        last edited by

        @seednextsrl you typically don't use the access token as a login password.

        The access token is what you present to other applications as proof that someone has logged in.

        There are a few FusionAuth APIs you can call and present the access token as a means of authentication. They are marked with a little blue person.

        Here's more about API authentication: https://fusionauth.io/docs/v1/tech/apis/authentication

        Here's an example of an API which uses a JWT to authenticate: https://fusionauth.io/docs/v1/tech/apis/users#retrieve-a-user (scroll to the "Retrieve a User using a JWT" section).

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

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