metabasepy icon indicating copy to clipboard operation
metabasepy copied to clipboard

Google Sign-On / LDAP Authentication Support

Open jackcsk opened this issue 5 years ago • 2 comments

Just wonder if there is any roadmap to support Google Sign-On / LDAP, or is there an alternative way to achieve that? Thanks.

jackcsk avatar Feb 23 '20 03:02 jackcsk

Hi, Yes, may be we can implement sign-in / authenticate feature. There is some information about it (https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#post-apisessiongoogle_auth) but i have to test / reverse-check this endpoint for reasonable client implementation. Metabase's api doc is very superficial...

mertsalik avatar Mar 20 '20 20:03 mertsalik

import requests

cookies = {

}

headers = { 'Connection': 'keep-alive', 'Accept': 'application/json', 'Sec-Fetch-Dest': 'empty', 'Content-Type': 'application/json', 'Accept-Language': 'en-US,en;q=0.9', }

data = '{"token":"YOU GOOGLE ID TOKEN HERE"}'

response = requests.post('https://YOUR BASE URL HERE/api/session/google_auth', headers=headers, cookies=cookies, data=data) from metabasepy import Client

cli = Client(username="fake", password="not_using", base_url="https://YOUR BASE URL HERE")

cli.token = response.json()['id']

gotya: https://github.com/metabase/metabase/issues/6594

helpful: https://github.com/googleapis/google-auth-library-python/blob/master/google/oauth2/id_token.py

gutdraw avatar Apr 03 '20 16:04 gutdraw