diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-04-20 18:08:41 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-04-20 18:08:41 +0300 |
commit | a5b936709740ab5b4a101155d6b99b423dff440b (patch) | |
tree | 73f9f948a015b2e78af9353654e06ab7c65c6429 /icktool | |
parent | 4c4663f8a67d38020e4da8629e87c5dbc5fb8d33 (diff) | |
download | ick2-a5b936709740ab5b4a101155d6b99b423dff440b.tar.gz |
Change: _new_auth should be given API so it can fetch token
Diffstat (limited to 'icktool')
-rwxr-xr-x | icktool | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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) |