Any Authentication tutorial on Python?

weemo33weemo33 Member Posts: 9
are there any tutorials (complete) for the authentication part using Python?


Thanks

13 comments

  • weemo33weemo33 Member Posts: 9
    I follow the documentation on here and I get this error

    "error":"invalid_grant","error_description":"Authorization code doesn't exist or is invalid for the client"
  • jamesratcliffejamesratcliffe Administrator, Lightspeed Staff Posts: 160 moderator
    Hi,

    At the moment all we have is the sample code in the authorization guide. We may add a sample python temporary token endpoint in the future, but it's significantly more complicated than with PHP. We would have to choose a specific web framework, and some of the code would be specific to that framework.
    James Ratcliffe
    Lightspeed HQ
  • weemo33weemo33 Member Posts: 9
    What are the grant types available? I have tried bearer, and authorization_code but none seem to do the trick. I am pretty sure I have the code right and it seems to point to the grant_type problem.

    Thanks
  • jamesratcliffejamesratcliffe Administrator, Lightspeed Staff Posts: 160 moderator
    Hi again.

    This error, ""Authorization code doesn't exist or is invalid for the client", usually means that more than 30 seconds have passed since you received the temporary token.

    It can also mean that the client ID used in the POST request doesn't match the client ID used to request access (in the first step).
    James Ratcliffe
    Lightspeed HQ
  • jamesratcliffejamesratcliffe Administrator, Lightspeed Staff Posts: 160 moderator
    The grant_type is authorization_code.
    James Ratcliffe
    Lightspeed HQ
  • weemo33weemo33 Member Posts: 9
    So I was able to piece things together on this and I was able to get the token. I have a few questions here after:

    1. do I refresh the token the same way I requested one?
    2. in the examples on the website, I keep seeing {AccoundID}
    Is {AccountID} given or is it the same as Client_ID?

    thx
  • jamesratcliffejamesratcliffe Administrator, Lightspeed Staff Posts: 160 moderator
    James Ratcliffe
    Lightspeed HQ
  • weemo33weemo33 Member Posts: 9
    Got it, thanks.
  • jamesratcliffejamesratcliffe Administrator, Lightspeed Staff Posts: 160 moderator
    No problem.
    James Ratcliffe
    Lightspeed HQ
  • aorzhaorzh Member Posts: 5
    edited June 2018
    weemo33 said:
    Got it, thanks.
    @weemo33 Can you share your experience?
    Post edited by jamesratcliffe on
  • weemo33weemo33 Member Posts: 9

    Just noticed this message. I was able to do a connection and pull records from Lightspeed. I did this back in October of 2018, I did not work more on it. I just had too many questions before proceeding so I left it in the backburner.

  • Jd_89050Jd_89050 Member Posts: 6

    @weemo how you solved this error

    "error":"invalid_grant","error_description":"Authorization code doesn't exist or is invalid for the client"

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 597 moderator

    Hey @Jd_89050,

    Could you send a code snippet detailing the request you're making?

    If you could also private message me your API client details as well I could take look into it


    @weemo33 what kind of issues were you running into?

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

Sign In or Register to comment.