Enables LINE OAuth2 login in Django apps via allauth adapter.
# Source: https://github.com/pennersr/django-allauth | License: MIT | Copyright 2010-2026 Raymond Penners and contributors
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations
from datetime import timedelta
from django.http import HttpRequest
from django.utils import timezone
from allauth.socialaccount import app_settings
from allauth.socialaccount.adapter import get_adapter
from allauth.socialaccount.models import SocialToken
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
class LineOAuth2Adapter(OAuth2Adapter):
provider_id = "line"
access_token_url = "https://api.line.me/oauth2/v2.1/token" # nosec
authorize_url = "https://access.line.me/oauth2/v2.1/
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key