Accessing REST API with Google OAuth

@edchlee - Try following these steps:

  1. Navigate to Metabase in Chrome
  2. Log out of Metabase if you are not logged out already
  3. Open the Developer window (or right click and select “inspect”)
  4. In the Developer window, go to the Network tab
  5. You will see a red record button in the upper left. Click that twice to reset the request tracking.
  6. Log into Metabase using Google Authentication
  7. Look for a request in the Network tab that starts with “iframerpc?action”. Click on that.
  8. Under “Headers” you will see several sections
    a.) General - Copy the Request URL from this section
    b.) Request Headers - Copy all of the elements from this section
  9. Make an API call to get the Session ID
    a.) URL = Request URL from the General section
    b.) Headers = Elements from the Request Headers section (if using Python , create and use dictionary of these items)
  10. The Response from the API call will include an element called “id_token”. This is your Session ID.
    NOTE: I personally did not have to include a payload in this particular API call

IMPORTANT : Keep in mind, that OAuth is meant to expire after a while (could be minutes, could a one or two days). The elements you copy and paste into your api call will eventually stop working, and you will have to repeat this process. I believe the element that changes is the “cookie” in the Request Headers

1 Like