これまで
今回やること
- Google Appの認証でログインするようにする
公式ドキュメントの手順に従ってやる
EC2ログイン
ubuntu というユーザー名でログインし、sudo suでルート権限になっておく
基本的にいじるファイルは/opt/redash/.envファイル
クッキーのシークレットキー変更
Update the cookie secret (important! otherwise anyone can sign new cookies and impersonate users): change “veryverysecret” in the line: export REDASH_COOKIE_SECRET=veryverysecret to something else (you can run the command pwgen 32 -1 to generate a random string).
推奨されたコマンドでシークレットキー作成
pwgen 32 -1
返ってきたランダムの文字列をコピーして/opt/redash/.envのexport REDASH_COOKIE_SECRETを変更し保存
adminのパスワード変更
By default we create an admin user with the password “admin”. You can change this password opening the: /users/me#password page after logging in as admin.
デフォルトのパスワードadminを任意のものに変更
ログインし、/users/me#password にアクセスし変更
ログアウトし、新しいパスワードでログインできればOK
Google Appsのログイン設定
公式の手順に従ってやる
http://docs.redash.io/en/latest/misc/google_developers_project.html
キー登録
Google Developers Consoleで得たクライアントIDとクライアントシークレットを/opt/redash/.envに登録する
export REDASH_GOOGLE_CLIENT_ID=""
export REDASH_GOOGLE_CLIENT_SECRET=""
登録させるドメインを指定
Configure the domain(s) you want to allow to use with Google Apps, by running the command:
cd /opt/redash/current
sudo -u redash bin/run ./manage.py org set_google_apps_domains {ドメイン}
成功するとUpdated list of allowed domains to: ['ドメイン'] と表示される。
サーバーリスタート
sudo supervisorctl restart redash_server
アクセスする
今までなかった Log In with Google が出現している。
ボタンタップしGoogleアカウントでログインできればOK