From a5b936709740ab5b4a101155d6b99b423dff440b Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 20 Apr 2018 18:08:41 +0300 Subject: Change: _new_auth should be given API so it can fetch token --- icktool | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'icktool') 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) -- cgit v1.2.1