Search code examples
apache-superset

How to get Superset Token?? (for use Rest api)


I attempted to request a REST request to see the document below. But do not work. https://superset.apache.org/docs/rest-api

request: curl -XGET -L http://[IP:PORT]/api/v1/chart

response: {"msg":"Bad Authorization header. Expected value 'Bearer <JWT>'"}

The Superset installation has been on PIP and was also Helm Chart. But all are the same. helm: https://github.com/apache/superset

How should I order a REST API?


Solution

  • open http://localhost:8080/swagger/v1, assuming http://localhost:8080 is your Superset host address then find this section enter image description here

    the response would be like this

    {
        "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjU0MzQ2OTM5LCJqdGkiOiJlZGY2NTUxMC0xMzI1LTQ0NDEtYmFmMi02MDc1MzhjZDcwNGYiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoxLCJuYmYiOjE2NTQzNDY5MzksImV4cCI6MTY1NDM0NzgzOX0.TfjUea3ycH77xhCWOpO4LFbYHrT28Y8dnWsc1xS_IOY",
        "refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTY1NDM0NjkzOSwianRpIjoiNzBiM2EyZDYtNDFlNy00ZDNlLWE0NDQtMTRiNTkyNTk4NjUwIiwidHlwZSI6InJlZnJlc2giLCJzdWIiOjEsIm5iZiI6MTY1NDM0NjkzOSwiZXhwIjoxNjU2OTM4OTM5fQ.OgcctNnO4zTDfTgtHnaEshk7u-D6wOxfxjCsjqjKYyE"
    }