I have a django web application that implements auth0 and works beautifully on any browser on pcs, macs and android, but when users started trying to go to my website from an iOS device (iphone, ipad, etc.), they found that when they try to type in their email or use Google or another authentication method, the device asks to download a file and then downloads a file called “en” and does nothing.
Has anyone else experienced such an issue? Any ideas what the problem is?
.
When I opened the document in Notepad++, it was the html file that auth0 should redirect to that was downloaded instead of rendered.
On the website on the iOS device, it just keeps hanging.
Can you raise that issue directly in the Django SDK repo on GitHub so we can work most effectively with the maintainer? Make sure to share the link to the issue here so we can ping them. Thanks!
I have narrowed the issue down to this: If I require login through auth0 and pass a context in the view the application has the behavior described above. If I don’t require login, passing a context is no problem. If I don’t pass a context, requiring login through auth0 is no problem. Again this issue only exists on iOS devices.
Ok. I figured this out. Problem is solved.
In the Django SDK, you show that you should pass in what I thought was an extra parameter for auth0:
{
‘auth0User’: auth0user,
‘userdata’: json.dumps(userdata, indent=4)
}
Not realizing that the above is the context parameter, I also added my own context in the return statement of the view like this:
return render(request, ‘mypage.html’, context, { ‘auth0User’: auth0user, ‘userdata’: json.dumps(userdata, indent=4)} )
So for some reason this worked on pcs and androids to pass in two contexts, but iOS didn’t like it.
Once I combined the two contexts
return render(request, ‘mypage.html’, {‘contextvar1’: ‘data’, ‘contextvar2’: ‘moredata’, ‘auth0User’: auth0user, ‘userdata’: json.dumps(userdata, indent=4)} )
everything works.