Auth0 for Django App on IOS - Problem

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?

Thank you.

Hey there!

Can you tell us what element of our stack are you using? Any docs / quickstarts links? Screenshots of the situation? Thanks!

I used the Django SDK quickstart. Here are some screenshots. After clicking to login, I get a document to download at the bottom.

. After clicking to download, the screen looks like this: .
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 did post this issue on github. I figured I would update my comments here as well in case anyone has experienced a similar issue. https://github.com/auth0/auth0-python/issues/218

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.

Even passing an empty context causes a problem.

Thanks for providing that context! I pinged repo maintainers regarding the issue

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.

1 Like

Perfect! Thanks for sharing it with the rest of community!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.