Hi everyone,
I’m currently working on integrating OAuth authentication into my Django application using Authlib and have run into an issue I’m hoping to get some help with.
When I try to handle the OAuth callback, I receive the following error:
sqlCopy code
OAuthError at /oidc/callback/
access_denied: You are accessing from an invalid application. Contact support.
Here’s the traceback for additional context:
scssCopy code
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/code/apps/auth/views.py", line 79, in callback
token = oauth.auth0.authorize_access_token(request)
File "/usr/local/lib/python3.8/site-packages/authlib/integrations/django_client/apps.py", line 67, in authorize_access_token
raise OAuthError(error=error, description=description)
authlib.integrations.base_client.errors.OAuthError: access_denied: You are accessing from an invalid application. Contact support.
What I’ve Tried:
- Confirmed that my Client ID and Client Secret match those provided by my OAuth provider.
- Verified that the callback URL in the OAuth provider settings matches my application.
- Checked that the application type is set correctly in the provider’s dashboard.
- Ensured that the necessary scopes are allowed in the provider settings.
- Tested using different browsers and cleared cookies to rule out local issues.
Despite these checks, I’m still encountering the error. Has anyone else faced this issue or have suggestions on what else I can investigate?
Any help would be greatly appreciated!
Thanks in advance!