summaryrefslogtreecommitdiff
path: root/icktool
diff options
context:
space:
mode:
Diffstat (limited to 'icktool')
-rwxr-xr-xicktool5
1 files changed, 5 insertions, 0 deletions
diff --git a/icktool b/icktool
index fa7f8f3..6d0b4e2 100755
--- a/icktool
+++ b/icktool
@@ -18,6 +18,7 @@
import configparser
import json
import logging
+import os
import sys
import cliapp
@@ -82,6 +83,7 @@ class Icktool(cliapp.Application):
['secrets'],
'use URL as the controller base URL',
metavar='URL',
+ default=os.path.expanduser('~/.config/icktool/credentials.conf'),
)
self.settings.boolean(
@@ -162,6 +164,9 @@ class Icktool(cliapp.Application):
def _new_auth(self):
url = self.settings['auth-url']
+ if not url:
+ api = self._new_api()
+ url = api.get_auth_url()
client_id, client_secret = self._get_client_creds(url)
ac = ick2.AuthClient()