Search code examples
phpgithuboauth-2.0github-apigithub-oauth

Verify if token not expired Github Oauth1


Hey i want know if github have a endpoint to verify if a access_token have expired ? I have tried this but i have a 404 error


Solution

  • 404 would mean you did not authenticate properly.
    Make sure to use a PAT (Personal Access Token) to authenticate your query (assuming you are not testing you own PAT itself!)

    curl \
      -X POST \
      -H "Accept: application/vnd.github+json" \
      -H "Authorization: Bearer <YOUR-TOKEN>" \    <==== Important
      https://api.github.com/applications/Iv1.8a61f9b3a7aba766/token \
      -d '{"access_token":"e72e16c7e42f292c6912e7710c838347ae178b4a"}'