pan-cortex-data-lake-python icon indicating copy to clipboard operation
pan-cortex-data-lake-python copied to clipboard

Developer token auth doesnt work anymore

Open tyler-horschig opened this issue 3 years ago • 4 comments

  • Cortex Data Lake Python SDK version: Latest
  • Python version: 3.7
  • Operating System: Mac

Description

The developer token authorization no longer works. You get a 400 Bad Request.

{ "msg": "Refresh operation failed: Token refresh failed: {"error_description":"unknown, invalid, or expired refresh token","error":"invalid_grant"}" }

What I Did

curl -H "Authorization: Bearer $PAN_DEVELOPER_TOKEN" -X POST https://app.apiexplorer.rocks/request_token

tyler-horschig avatar Jul 15 '22 16:07 tyler-horschig

:tada: Thanks for opening your first issue here! Welcome to the community!

Hi @dedsec594, judging by the error message, it appears your grant may have expired. If so, you'll need to reauthorize the instance (delete the existing instance under Authorizations and start the authorization flow from the Cortex hub).

After reauthorizing you may need to generate a new developer token.

sserrata avatar Jul 15 '22 17:07 sserrata

@sserrata We originally set the token to never expire. Is there a way to set the instance to never expire? We just followed this guide when we set it up: https://cortex.pan.dev/docs/data_lake/learn/apiexplorer_authorization and then this guide: https://cortex.pan.dev/docs/data_lake/learn/developer_tokens to get the developer token.

tyler-horschig avatar Jul 15 '22 17:07 tyler-horschig

The OAuth 2.0 grant expiration is handled separately from developer token expiration. That said, you may want to open a TAC issue to inquire about setting the grant to never expire.

sserrata avatar Jul 15 '22 19:07 sserrata