useme-com / revolut-python

Revolut API client for Python
BSD 3-Clause "New" or "Revised" License
47 stars 14 forks source link

Token changes? #8

Open MrSurf67 opened 2 years ago

MrSurf67 commented 2 years ago

Having trouble at step 12 and wonder if anything has changed recently. revolut_getjwt no longer seems to need the decode on the return, otherwise believe I have a valid jwt - generate new auth_code and request token but always get 400 status to the post for the token:

unauthorized_client: Failed to authorise client

Any help appreciated.

MrSurf67 commented 2 years ago

DEBUG:revolut.session:TokenProvider request data: { "client_assertion": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3d3cudGVrZXZlci5jb20iLCJzdWIiOiJvYV9wcm9kX3NxVk1MR0JqLWZ3NXF1NEtpTU5HU3IzcFNtTldMV2IxeHI5QVJVcXpRZ0UiLCJhdWQiOiJodHRwczovL3Jldm9sdXQuY29tIn0.DvCJF8Z5vpWR4rTRmd4NBWnYN3NJhEW8LbOQ7dz13S3wZl9StNL-NPm_LfFN5YuWk8aO57tqra5FrxRJYwqM-Le0OmIFcXdGdCzC-dZkkzYBsuisEc8fGgZf4BKrhFQSeg2DQrzwTHfprHPxHHQTO-_aEom6FEpPlPdfSJGEj-Y", "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", "client_id": "jU61WxPv2Q1g1vKbzItJjbw7uv1g6aQg7C0yeq74SVE", "code": "oa_prod_sqVMLGBj-fw5qu4KiMNGSr3pSmNWLWb1xr9ARUqzQgE", "grant_type": "authorization_code" } DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): b2b.revolut.com:443 DEBUG:urllib3.connectionpool:https://b2b.revolut.com:443 "POST /api/1.0/auth/token HTTP/1.1" 400 None DEBUG:revolut.session:TokenProvider result: { "error": "unauthorized_client", "error_description": "Failed to authorise client" }

emesik commented 2 years ago

I think Revolut changed the authorization method AGAIN. They now require X.509 certificates, which is not implemented but will be as soon as we need it :/ Of course, PRs are always welcome if you chose to go ahead :)

MrSurf67 commented 2 years ago

I thought the X.509 certificate was just for the first steps. Their documentation still talks about JWT for token exchange. Without the documentation update it's hard to know what to program differently!?

emesik commented 2 years ago

Well, unfortunately they don't mention upcoming changes, nor version the API.