概要
WSL(Ubuntu22.04)でaws sso loginするとブラウザが起動せずOperation not supportedが表示される
エラーメッセージ詳細
# aws sso login --profile 123456789012_BasicAccessRights
Attempting to automatically open the SSO authorization page in your default browser.
If the browser does not open or you wish to use a different device to authorize this request, open the following URL:
https://device.sso.ap-northeast-1.amazonaws.com/
Then enter the code:
XXXX-XXXX
gio: https://device.sso.ap-northeast-1.amazonaws.com/?user_code=XXXX-XXXX: Operation not supported
^C
環境
- Windows10
- WSLv2
- Ubuntu22.04
- AWS CLI v2(2.13.7)
対処
BROWSER環境変数でPCローカル(Windows)のブラウザのファイルパスを設定する
ローカルで利用するブラウザがChromeの場合のファイルパス
C:\Program Files\Google\Chrome\Application\chrome.exe
chrome以外であれば、実行中のアプリのショートカットのプロパティをたどってファイルパスを確認する。
ファイルパスをLinux用に変換する(/mnt/c/..)
bashの場合
export BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"
fishの場合
set -x BROWSER "/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"
参考リンク
AWS CLI fail to open links - e.g. the IAM Identity Center - "Operation not supported" · Issue #7892 · aws/aws-cli