summaryrefslogtreecommitdiff
path: root/icktool
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-04-20 18:08:41 +0300
committerLars Wirzenius <liw@liw.fi>2018-04-20 18:08:41 +0300
commita5b936709740ab5b4a101155d6b99b423dff440b (patch)
tree73f9f948a015b2e78af9353654e06ab7c65c6429 /icktool
parent4c4663f8a67d38020e4da8629e87c5dbc5fb8d33 (diff)
downloadick2-a5b936709740ab5b4a101155d6b99b423dff440b.tar.gz
Change: _new_auth should be given API so it can fetch token
Diffstat (limited to 'icktool')
-rwxr-xr-xicktool8
1 files changed, 4 insertions, 4 deletions
diff --git a/icktool b/icktool
index 383d364..100f08a 100755
--- a/icktool
+++ b/icktool
@@ -156,8 +156,8 @@ class Icktool(cliapp.Application):
api.set_controller_url(self.settings['controller'])
return api
- def _new_auth(self):
- url = self.settings['auth-url']
+ def _new_auth(self, api):
+ url = api.get_auth_url()
client_id, client_secret = self._get_client_creds(url)
ac = ick2.AuthClient()
@@ -165,10 +165,10 @@ class Icktool(cliapp.Application):
ac.set_client_creds(client_id, client_secret)
return ac
- def _new_token(self):
+ def _new_token(self, api):
if self.settings['token']:
return self.settings['token']
- ac = self._new_auth()
+ ac = self._new_auth(api)
scopes = ' '.join(self.settings['scope'])
return ac.get_token(scopes)