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

Add Apple as a provider #231

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

erral
Copy link

@erral erral commented Feb 28, 2024

I have been working on adding Apple as an authentication provider into Authomatic.

To do so I had to introduce 2 changes in the OAuth2 base class:

  • Add a method to get the secret for the access token request phase: Apple's OAuth2 implementation requires a specific secret to be sent in the access token request. This secret is a JWT token encoded with a secret that Apple provides when registering the client. That's why I introduce a method to get the credentials, which in base OAuth2 just returns the consumer secret, and in Apple returns the dedicated JWT token. To do so, I introduce PyJWT as a requirement of the package.
  • Add a method to get extra params that Apple requires in the access token phase: Apple requires to send the response_mode param, so I add a dummy method that returns nothing in the base OAuth2 class and then the method that returns what Apple requires in its own baseclass.

I don't exactly know whether Apple's implementation is a fully OAuth2 compliant implementation, so I am OK if this PR is completely disregarded. I just wanted to let you know about these changes and discuss them before integrating into Authomatic.

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

2 participants