Metabase API Session token


I I am trying to get my session token from metabase and I am using the /api/session API to find it. But when i pass the authentication values using the curl command shown below, I get the output as a single character ‘P’. My metabase is running on 8443. Any help would be appreciated.

curl -X POST
-H “Content-Type: application/json”
-d ‘{“username”: ““, “password”: “MetabasePassword”}’

Hi @devops

I’m not sure if the forum is messing with formatting, but you’re not using plain double/single quotes.

curl -X POST -H "Content-Type: application/json" -d '{"username": "", "password": "MetabasePassword"}' http://localhost:8443/api/session 

You can add verbose to the command to see more debugging details with curl --verbose ...

Also, are you using SSL/TLS in Jetty or via a reverse proxy? Then you need to change http:// to https://

And lastly, check the Metabase log to see if you’re even talking to Metabase yet.

My access to Metabase is set up so that I use SSO using my company gmail account -- as a result, I don't have an actual password associated with that email. Any input on how to get a API session token in this case?


You have to programmatically get the session token following the OAuth2 flow. Please upvote We should support an alternative API authentication mechanism · Issue #2699 · metabase/metabase · GitHub