Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched login flow to code authorization #71

Merged
merged 1 commit into from
Sep 11, 2021

Conversation

adn77
Copy link

@adn77 adn77 commented Sep 10, 2021

I adapted the login flow based on recent proxy intercepts and this:
mkb79/Audible#41

Fyi, I have zero knowledge of modern JS so please be gentle with any critism :D

@Apollon77
Copy link
Owner

Cool, thank you. Is also the token refresh working?

@volschin
Copy link

As I understand both methods are working at the moment. Could it be better to let choose the method by a switch?

@Apollon77
Copy link
Owner

All good this was not the question. It was about if the token refresh mechanismus is still working also when doing a new login with this method?

@adn77
Copy link
Author

adn77 commented Sep 11, 2021

As this method returns a refresh_token, I believe the refresh is just the same. I'll test some more tonight.

Please review the code, especially the parts deleted... I didn't quite understand all the callback stuff ;)

@Apollon77
Copy link
Owner

Please review the code, especially the parts deleted... I didn't quite understand all the callback stuff ;)

Will also try to find time tonight

@adn77
Copy link
Author

adn77 commented Sep 11, 2021

access_token refresh works:

POST /auth/token HTTP/1.1
x-amzn-identity-auth-domain: api.amazon.de

app_name=ioBroker Alexa2
app_version=2.2.223830.0
di.sdk.version=6.10.0
di.hw.version=iPhone
di.os.name=iOS
di.os.version=11.4.1
package_name=com.amazon.echo
platform=iOS
current_version=6.10.0
requested_token_type=access_token
source_token_type=refresh_token
source_token=Atnr|...

I don't quite understand what the access_token is used for. I can always use the refresh_token to retrieve the cookies:
(There seems to be a change for the exchangetoken endpoint)

POST /ap/exchangetoken/cookies HTTP/1.1
x-amzn-identity-auth-domain: api.amazon.de

requested_token_type=auth_cookies
app_name=Amazon Alexa
app_version=2.2.223830.0
di.sdk.version=6.10.0
domain=www.amazon.de
source_token_type=refresh_token
source_token=Atnr|...

Note: no cookies were required when making the request!

That leaves the renewal of the refresh_token... unless it never expires.

@Apollon77
Copy link
Owner

Thnak you for checking!

@Apollon77
Copy link
Owner

Changes make sense ... thank you, I will merge now and release as new version next days

@Apollon77 Apollon77 merged commit 43afb27 into Apollon77:master Sep 11, 2021
@Apollon77
Copy link
Owner

@adn77 BTW I made the refresh flow working with both in the end ... lets see how it goes midterm.

I'm not that sure that code-verieir and auth.code is working "long time"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants