Implementing Apple Sign in using django-allauth

I am currently implementing social login using django-allauth. I've had no problems implementing social logins like Google, Facebook and etc. However, when it came to Apple, the package doesn't seem to work properly.

I've been testing the logins using https. Also, I've completed settings in Apple Developer and Django Admin.

The below is the capture of my login page.

enter image description here

when I click on apple icon, it gets redirected to apple page to proceed.

enter image description here

When I enter the apple login and complete authentication on apple site, the browser throws Server Error(500).

enter image description here

I believe my settings for apple sign-in have been correct. The below is my admin settings for apple sign-in.

enter image description here

I tried to search the references on the internet but I couldn't find anyone experienced the same issue. I have no idea on how to resolve this issue nor do I know the way to find where the error is coming from.

Could anyone suggest any method on how to implement apple sign-in using django-allauth package?

Thanks,

The "certification_key" in settings.py file that you're providing doesn't seem to be in the correct format. Make sure that you copy the downloaded key and preserve the line format. Also, make sure to add the certification key in triple quotation marks. I.e.

SOCIALACCOUNT_PROVIDERS = {
    "apple": {
        "APP": {
            # Your service identifier.
            "client_id" : "example.login",

            # The Key ID (visible in the "View Key Details" page).
            "secret": "1ZBEDD1B.com.example",

            "key": "ABW34RZ6",

            # The certificate you downloaded when generating the key.
            "certificate_key": """----BEGIN PRIVATE KEY--
s3cr3ts3cr3ts3cr3ts3cr3ts3cr3ts3cr3ts3cr3ts3cr3ts3cr3ts3cr3ts3cr
s3cr3ts3cr3ts3cr3ts3cr3ts3cr3ts3cr3ts3cr3ts3cr3ts3cr3ts3cr3ts3cr
c3ts3cr3t
-----END PRIVATE KEY-----
"""
        }
    }
}

An example is also provided in the django-allauth documentation https://django-allauth.readthedocs.io/en/latest/providers.html#apple

Back to Top