Commit d03e9ee1 authored by Sylvie Ye's avatar Sylvie Ye Committed by Romain Bignon

[cmso] get tokens for navigation separately

the old regexp was id_token=(?P<id_token>[^&]+)&access_token=(?P<access_token>[^&]+)
and now it's access_token=(?P<access_token>[^&]+)&id_token=(?P<id_token>[^&]+)

get tokens separately to avoid this
parent a91ad8c4
......@@ -29,7 +29,7 @@ from weboob.browser.filters.html import Link, Attr, TableCell
from import Account, Investment
from weboob.capabilities.base import NotAvailable
from import FrenchTransaction
from import urljoin
from import urljoin, parse_qsl
from import is_isin_valid
......@@ -284,9 +284,13 @@ class SSODomiPage(JsonPage, UpdateTokenMixin):
class TokenPage(CMSOPage, UpdateTokenMixin):
def on_load(self):
d ='id_token=(?P<id_token>[^&]+)&access_token=(?P<access_token>[^&]+)', self.text).groupdict()
self.browser.token = d['id_token']
self.browser.csrf = d['access_token']
auth_query_params ='parent\.location = ".*#(.*)";', self.text)
assert auth_query_params, 'Url query parameter with token for authentication was not found'
auth_query_params =
params = dict(parse_qsl(auth_query_params))
self.browser.token = params['id_token']
self.browser.csrf = params['access_token']
class AuthCheckUser(HTMLPage):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment