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

feat(ebay): Starting work on eBay OAuth Provider #3483

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kareemassad
Copy link

@kareemassad kareemassad commented Oct 14, 2023

Submitting Pull Requests

General

  • Make sure you use semantic commit messages.
    Examples: "fix(google): Fixed foobar bug", "feat(accounts): Added foobar feature".
  • All Python code must formatted using Black, and clean from pep8 and isort issues.
  • JavaScript code should adhere to StandardJS.
  • If your changes are significant, please update ChangeLog.rst.
  • If your change is substantial, feel free to add yourself to AUTHORS.

Provider Specifics

In case you add a new provider:

  • Make sure unit tests are available.
  • Add an entry of your provider in test_settings.py::INSTALLED_APPS and docs/installation.rst::INSTALLED_APPS.
  • Add documentation to docs/providers/<provider name>.rst and docs/providers/index.rst Provider Specifics toctree.
  • Add an entry to the list of supported providers over at docs/overview.rst.

Copy link
Owner

@pennersr pennersr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing. I added a few comments -- can you look into these?

allauth/socialaccount/providers/ebay/provider.py Outdated Show resolved Hide resolved
allauth/socialaccount/providers/ebay/views.py Outdated Show resolved Hide resolved
allauth/socialaccount/providers/ebay/views.py Outdated Show resolved Hide resolved
@kareemassad
Copy link
Author

Hello,

EBay uses a two part authentication system. First, we need to get the user's consent (and specify scopes of the application), then we place the authorization code grant request to get a User access token and a refresh token. (I am following the docs here: https://developer.ebay.com/api-docs/static/oauth-consent-request.html, https://developer.ebay.com/api-docs/static/oauth-auth-code-grant-request.html.

Is it possible to support this? We would need to have a way to pass scopes. Would that be part of settings aswell?

Sorry for the questions!

Thanks!

@pennersr
Copy link
Owner

Is it possible to support this? We would need to have a way to pass scopes. Would that be part of settings aswell?

What you describe is regular OAuth2 functionality -- the other providers do similar things. I suggest you have a look at the OAuth2Provider class, specifically the get_scope() method. As you can see there, there is already a uniform way in which providers get ahold of the scopes, so this is not something you need a custom implementation for.

@kareemassad
Copy link
Author

I implemented some of the changes discussed. I wrote some tests (probably more than necessary), but I am not too sure how to test it

@kareemassad kareemassad marked this pull request as draft October 25, 2023 00:32
@kareemassad kareemassad marked this pull request as ready for review October 25, 2023 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants