Skip to content

Commit 9ad5fad

Browse files
committed
Fix Nissan oauth realm changes
1 parent 01c98ca commit 9ad5fad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

custom_components/nissan_connect/kamereon/kamereon.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ def login(self, username=None, password=None):
151151
_LOGGER.error("Invalid credentials provided: %s", resp.text)
152152
raise RuntimeError("Invalid credentials")
153153

154-
oauth_authorize_url = '{}oauth2{}/authorize'.format(
154+
oauth_authorize_url = '{}oauth2/{}/authorize'.format(
155155
self.settings['auth_base_url'],
156-
oauth_data['realm']
156+
self.settings['realm']
157157
)
158158
nonce = generate_nonce()
159159
resp = self.session.get(
@@ -168,9 +168,9 @@ def login(self, username=None, password=None):
168168
allow_redirects=False)
169169
oauth_authorize_url = resp.headers['location']
170170

171-
oauth_token_url = '{}oauth2{}/access_token'.format(
171+
oauth_token_url = '{}oauth2/{}/access_token'.format(
172172
self.settings['auth_base_url'],
173-
oauth_data['realm']
173+
self.settings['realm']
174174
)
175175
self._oauth = OAuth2Session(
176176
client_id=self.settings['client_id'],

0 commit comments

Comments
 (0)