get csrf token error when login with okta
tried to login with okta, and then it got csrf token error, i checked the request there's csrf token in it. I am running in django 1.11
Oh probably you need to disable CSRF in SSO urls. I'm using okta as well it works well.
How would you suggest doing this?
When I try this
path('saml2_auth/', csrf_exempt(include('django_saml2_auth.urls')), name='django_saml2_auth')
I get an Exception at /accounts/login/
We got a URL reverse issue: [<function acs at 0x7fc3b7bfbea0>, 'acs', 'django_saml2_auth:acs']. This is a known issue but please still submit a ticket at https://github.com/fangli/django-saml2-auth/issues/new
I am getting the same issue of CSRF authentication even after doing the csrf_exempt. Can you suggest something?
BUMP
Oh probably you need to disable CSRF in SSO urls.
I'm unable to disable csrf for the SSO urls, any advice?
@jmuyskens and @Ikjot-Kaur
so after a bit o' fiddling with this I realized what the issue is, and that is when you are configuring your Okta app you need to check the box that says Allow this app to request other SSO URLs
And then in the requestable urls section you need to add:
- http://mysite/saml2_auth/acs/
- http://mysite/saml2_auth/welcome/
- http://mysite/saml2_auth/denied/
This is now working for me.
I also had to create some attribute statements.
-
Email -
UserName -
FirstName -
LastName
So that when a new user logged in an account would get created for them.