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

Grammar check on authorization.rst #105

Merged
merged 2 commits into from
Aug 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 22 additions & 23 deletions docs/source/auth/authorization.rst
Original file line number Diff line number Diff line change
@@ -6,15 +6,15 @@ Information
===========

Clients are authorized using OpenID in Authorization Code Flow with PKCE.
Once a client has successfully authorized to Amazon, they are get an
Once a client has successfully authorized to Amazon, they receive an
`authorization code` for device registration to Audible/Amazon.

.. _authorization:

Authorization
=============

For an example how to authorize please take a look at :ref:`hello_library`.
For an example on authorization, please take a look at :ref:`hello_library`.

CAPTCHA
-------
@@ -24,7 +24,7 @@ CAPTCHA
Init cookies added to login function to prevent CAPTCHAs in most cases.

Authorization requires answering a CAPTCHA in some cases. By default Pillow is used
to show captcha and an user prompt will be provided to enter your answer, which
to show captcha and a user prompt will be provided to enter your answer, which
looks like::

Answer for CAPTCHA:
@@ -48,7 +48,7 @@ external service), like so::
2FA (OTP Code)
--------------

If two-factor authentication (2FA) is activated a user prompt will be provided
If two-factor authentication (2FA) is activated, a user prompt will be provided
using `input` to enter your one time password (OTP), which looks like::

"OTP Code: "
@@ -66,7 +66,7 @@ A custom callback can be provided, like so::
otp_callback=custom_otp_callback
)

If you have to enter a otp often and don't care about security you can use
If you have to enter an OTP often and don't care about security, you can use
the `pyotp <https://pypi.org/project/pyotp/>`_ package with a custom callback
like so::

@@ -78,14 +78,14 @@ like so::
otp = TOTP(secret)
return str(otp.now())

Another approach for submit the OTP is to append the current OTP to the password.
Another approach is to append the current OTP to the password.

CVF Code
--------

If 2FA is deactivated and amazon detects some security risks (too many logins
If 2FA is deactivated and Amazon detects some security risks (too many logins
in short times, etc.) you will be asked for a verify code (CVF). In that case,
amazon sends you a Mail or SMS with a code, you have to enter here::
amazon sends you an email or SMS with a code, which you enter here::

"CVF Code: "

@@ -105,15 +105,13 @@ A custom callback can be provided, like so::
Approval Alert
--------------

Some users report, that authorize to audible gives them an approval alert and
you will receive an email from amazon. Since audible v0.5 you will get an user
prompt which looks like::
Some users report that trying to authorize with audible gives them an approval alert and an email from amazon.
Since audible v0.5 you will get a user prompt which looks like::

"Approval alert detected! Amazon sends you a mail."
"Please press enter when you approve the notification."

Please approve the amazon email notification and press enter (or another key)
to proceed.
Please approve the email/SMS, and press any key to continue.

.. versionadded:: 0.5.1

@@ -124,7 +122,7 @@ A custom callback can be provided, like so::
def custom_approval_callback():
# You can let python check for the received Amazon mail and
# open the approval link. The login function wait until
# open the approval link. The login function waits until
# the callback function is executed. The returned value will be
# ignored by the login function.
@@ -147,21 +145,21 @@ To handle the login with a external browser or program logic you can do the foll
auth = audible.Authenticator.from_login_external(locale=COUNTRY_CODE)

By default, this code print out the login url for the selected country code. Now you have
to copy and paste this code into a web browser (or a custom program) and authorize yourself.
By default, this code prints out the login url for the selected country code.
Paste this url into a web browser or use it programatically to authorize yourself.
You have to enter your credentials two times (because of missing init cookies).
On first time, the password can be a random one.
On second time, you have to solve a captcha before you can submit the login form with your
correct password.
After authorize successfully you will end in an error page (not found). This is correct.
Please copy the url from the address bar from your browser and paste the url to the input
field of the python code. This url looks like
First time, the password can be a random one.
Second time, you have to solve a captcha before you can submit the login form and
you must use your correct password.
After loggin in, you will end in an error page (not found). This is correct.
Copy the url from the address bar from your browser and paste the url into the input
field of the python code. It will look something like
"https://www.amazon.{domain}/ap/maplanding?...&openid.oa2.authorization_code=..."

.. note::
If you have `playwright <https://pypi.org/project/playwright/>`_ installed and
use the default ``login_url_callback``, a new browser is opened, where you can
authorize to your account,
authorize to your account.

.. note::

@@ -187,3 +185,4 @@ A custom callback can be provided (for example open the url in a webbrowser dire
login_url_callback=custom_login_url_callback
)