CLI Error: `Authentication token has expired` immediately after getting a new token


#1

If the token you’re receiving from the provided OAUTH url when trying to authenticate from the CLI, make sure that you have recently logged into Astronomer platform.

Sometimes, your browser will cache the OAUTH page and present to you an expired token. Logging back in via the UI will make sure this page refreshes and a valid token is presented to you.


#2

^ this also worked for me when I kept getting redirected back to the app page when trying to access an airflow deployment


#3

Quick update that this is a known bug on our platform. GitHub issue here: https://github.com/astronomer/astronomer/issues/250

If a user tries logging into the Astronomer CLI when their browser session on app.astronomer.cloud
has expired, the CLI will direct that user to a token page (with an expired token) instead of recognizing that that token will be expired and route you directly back to the login page for a user to then retrieve a new token.

For now, you’ll have to go back to app.astronomer.cloud, make sure you’re logged in, and then follow the authorization process via the Astronomer CLI.