blacs30 / bitwarden-alfred-workflow

Simple Bitwarden Workflow for Alfred
MIT License
448 stars 31 forks source link

Login to Bitwarden failed, There is no request for the url port I filled in. #153

Closed JustCrazyer closed 1 year ago

JustCrazyer commented 1 year ago

Thank you very much for writing this workflow and sharing it. I use ipv6, the http://url:5139 filled in in my configuration, but Log input does not display ports: Error:request to https://****.****.com/identity/connect/token failed, reason: connect ECONNREFUSED, and the output of the system log is IP address:443 2401:8a02:54b3:****:265e:beff:fe2d:62a8:443, But I didn't set port 443.

I tried to add / to the last url in the configuration file. Still reporting errors I'm not sure if it's a port problem or other problems. I don't have any solution now, so I'm here to ask for help. Thank you.

I am getting the following error when trying to login:

[21:58:47.831] Bitwarden v2[Script Filter] Queuing argument '(null)'
[21:58:48.120] Bitwarden v2[Script Filter] Script with argv '(null)' finished
[21:58:48.123] STDERR: Bitwarden v2[Script Filter] 🍺
21:58:48 workflow.go:328: -------- Bitwarden v2/2.4.7 (AwGo/0.27.1) --------
21:58:48 main.go:162: &main.options{Search:false, Config:false, SetConfigs:false, Auth:false, OnOffConfigs:false, AuthConfig:false, Lock:false, Icons:false, Folder:false, Unlock:false, Login:false, Logout:false, Sync:false, Open:false, GetItem:false, Force:false, Totp:false, Last:false, Background:false, Id:"", Query:"", Attachment:"", Output:""}
21:58:48 main.go:164: args=[]string{} => []string{}
21:58:48 main.go:165: (main.config) {
 AutoFetchIconCacheAge: (int) 1440,
 AutoFetchIconMaxCacheAge: (time.Duration) 24h0m0s,
 BwconfKeyword: (string) (len=9) ".bwconfig",
 BwauthKeyword: (string) (len=7) ".bwauth",
 BwKeyword: (string) (len=3) ".bw",
 BwfKeyword: (string) (len=4) ".bwf",
 BwExec: (string) (len=2) "bw",
 BwDataPath: (string) (len=53) "~/Library/Application Support/Bitwarden CLI/data.json",
 Debug: (bool) false,
 Email: (string) (len=16) "**********",
 EmailMaxWait: (int) 15,
 EmptyDetailResults: (bool) false,
 IconCacheAge: (int) 43200,
 IconCacheEnabled: (bool) true,
 IconMaxCacheAge: (time.Duration) 720h0m0s,
 MaxResults: (int) 1000,
 Mod1: (string) (len=3) "alt",
 Mod1Action: (string) (len=13) "username,code",
 Mod2: (string) (len=5) "shift",
 Mod2Action: (string) (len=3) "url",
 Mod3: (string) (len=4) "ctrl",
 Mod3Action: (string) (len=4) "totp",
 Mod4: (string) (len=7) "cmd,opt",
 Mod4Action: (string) (len=4) "more",
 Mod5: (string) (len=9) "cmd,shift",
 Mod5Action: (string) (len=5) "webui",
 NoModAction: (string) (len=13) "password,card",
 OpenLoginUrl: (bool) true,
 OutputFolder: (string) (len=26) "/Users/****/Downloads/",
 Path: (string) (len=101) "/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/usr/bin:/usr/sbin:/usr/local/bin/bw",
 ReorderingDisabled: (bool) true,
 Server: (string) (len=40) "https://****.****.com:5139",
 Sfa: (bool) true,
 SfaMode: (int) 0,
 SkipTypes: (string) "",
 TitleWithUser: (bool) true,
 TitleWithUrls: (bool) true,
 UseApikey: (bool) true,
 WebUiURL: (string) (len=40) "https://****.****.com:5139"
}
21:58:48 feedback.go:509: Sent 3 result(s) to Alfred
21:58:48 workflow.go:405: ------------------- 60.03742ms -------------------
[21:58:48.127] Bitwarden v2[Script Filter] {
  "variables": {
    "AW_SESSION_ID": "16D0CRUWLU4ESM385FLHN4K2"
  },
  "items": [
    {
      "title": "Not logged in to Bitwarden.",
      "subtitle": "Need to login first.",
      "valid": false,
      "icon": {
        "path": "icons/warning.png"
      }
    },
    {
      "title": "Login to Bitwarden",
      "subtitle": "↩ or ⇥ to login now",
      "valid": true,
      "icon": {
        "path": "icons/on.png"
      },
      "variables": {
        "action": "-login",
        "email": "**********",
        "mapsfamode": "Authenticator-app",
        "sfamode": "0",
        "type": "login"
      }
    },
    {
      "title": "Cache expired/not existing. Need to run a sync.",
      "subtitle": "Sync Bitwarden secrets with server.",
      "arg": "-background",
      "valid": true,
      "icon": {
        "path": "icons/reload.png"
      },
      "variables": {
        "action": "-sync",
        "action2": "-force",
        "notification": "Syncing Bitwarden secrets"
      }
    }
  ]
}
[21:58:49.708] Bitwarden v2[Script Filter] Processing complete
[21:58:49.719] Bitwarden v2[Script Filter] Passing output '' to Conditional
[21:58:49.721] Bitwarden v2[Conditional] Processing complete
[21:58:49.722] Bitwarden v2[Conditional] Passing output '' to Hide Alfred
[21:58:49.724] Bitwarden v2[Hide Alfred] Processing complete
[21:58:49.725] Bitwarden v2[Hide Alfred] Passing output '' to Run Script
[21:58:57.967] ERROR: Bitwarden v2[Run Script] 🍺
21:58:49 workflow.go:328: -------- Bitwarden v2/2.4.7 (AwGo/0.27.1) --------
21:58:49 main.go:162: &main.options{Search:false, Config:false, SetConfigs:false, Auth:false, OnOffConfigs:false, AuthConfig:false, Lock:false, Icons:false, Folder:false, Unlock:false, Login:true, Logout:false, Sync:false, Open:false, GetItem:false, Force:false, Totp:false, Last:false, Background:false, Id:"", Query:"", Attachment:"", Output:""}
21:58:49 main.go:164: args=[]string{"-login"} => []string{}
21:58:49 main.go:165: (main.config) {
 AutoFetchIconCacheAge: (int) 1440,
 AutoFetchIconMaxCacheAge: (time.Duration) 24h0m0s,
 BwconfKeyword: (string) (len=9) ".bwconfig",
 BwauthKeyword: (string) (len=7) ".bwauth",
 BwKeyword: (string) (len=3) ".bw",
 BwfKeyword: (string) (len=4) ".bwf",
 BwExec: (string) (len=2) "bw",
 BwDataPath: (string) (len=53) "~/Library/Application Support/Bitwarden CLI/data.json",
 Debug: (bool) false,
 Email: (string) (len=16) "**********",
 EmailMaxWait: (int) 15,
 EmptyDetailResults: (bool) false,
 IconCacheAge: (int) 43200,
 IconCacheEnabled: (bool) true,
 IconMaxCacheAge: (time.Duration) 720h0m0s,
 MaxResults: (int) 1000,
 Mod1: (string) (len=3) "alt",
 Mod1Action: (string) (len=13) "username,code",
 Mod2: (string) (len=5) "shift",
 Mod2Action: (string) (len=3) "url",
 Mod3: (string) (len=4) "ctrl",
 Mod3Action: (string) (len=4) "totp",
 Mod4: (string) (len=7) "cmd,opt",
 Mod4Action: (string) (len=4) "more",
 Mod5: (string) (len=9) "cmd,shift",
 Mod5Action: (string) (len=5) "webui",
 NoModAction: (string) (len=13) "password,card",
 OpenLoginUrl: (bool) true,
 OutputFolder: (string) (len=26) "/Users/****/Downloads/",
 Path: (string) (len=101) "/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/usr/bin:/usr/sbin:/usr/local/bin/bw",
 ReorderingDisabled: (bool) true,
 Server: (string) (len=40) "https:/`/****.****.com:5139",
 Sfa: (bool) true,
 SfaMode: (int) 0,
 SkipTypes: (string) "",
 TitleWithUser: (bool) true,
 TitleWithUrls: (bool) true,
 UseApikey: (bool) true,
 WebUiURL: (string) (len=40) "https://****.****.com:5139"
}
21:58:49 bitwarden.go:462: Use apikey true
21:58:57 utils.go:32: [ERROR] ==>  [request to https://****.****.com/identity/connect/token failed, reason: connect ECONNREFUSED 2401:8a02:54b3:****:265e:beff:fe2d:62a8:443]
21:58:57 utils.go:44: [ERROR] ==> Exit code 1. Login to Bitwarden failed. Err: request to https://****.****.com/identity/connect/token failed, reason: connect ECONNREFUSED 2401:8a02:54b3:****:265e:beff:fe2d:62a8:443
21:58:57 workflow.go:376: [ERROR] Login to Bitwarden failed. Error:
request to https://****.****.com/identity/connect/token failed, reason: connect ECONNREFUSED 2401:8a02:54b3:****:265e:beff:fe2d:62a8:443
21:58:57 workflow.go:379: Get help at https://github.com/blacs30/bitwarden-alfred-workflow/issues
21:58:57 workflow.go:402: ------------------ 8.180311607s ------------------
[21:58:57.983] Bitwarden v2[Run Script] Processing complete
[21:58:57.985] Bitwarden v2[Run Script] Passing output 'Login to Bitwarden failed. Error:
request to https://****.****.com/identity/connect/token failed, reason: connect ECONNREFUSED 2401:8a02:54b3:****:265e:beff:fe2d:62a8:443' to Conditional
[21:58:57.985] Bitwarden v2[Conditional] Processing complete
[21:58:57.986] Bitwarden v2[Conditional] Passing output 'Login to Bitwarden failed. Error:
request to https://****.****.com/identity/connect/token failed, reason: connect ECONNREFUSED 2401:8a02:54b3:****:265e:beff:fe2d:62a8:443' to Post Notification
blacs30 commented 1 year ago

Does your setup work with the bitwarden cli - without the Alfred Workflow. The workflow uses the cli underneath. You can configure your servers directly via the cli and then there is no need to do it via the workflow.

JustCrazyer commented 1 year ago

Does your setup work with the bitwarden cli - without the Alfred Workflow. The workflow uses the cli underneath. You can configure your servers directly via the cli and then there is no need to do it via the workflow.

Thank you for your patient reply. After configuring the url in bitwarden cli, I have logged in successfully.

blacs30 commented 1 year ago

Sorry that my first answer was rather short. Did you get past the icon refresh step?

JustCrazyer commented 1 year ago

Sorry that my first answer was rather short. Did you get past the icon refresh step?

Sorry for the late reply.

After successfully logging in last time, it took me a few days to test and found that it was more suitable for me to use browser plug-ins and clients, so I gave up using Bitwarden Alfred Workflow.

I remember that I past the icon refresh step, but it took a while.