Mart
Mart

Reputation: 1

Django Single sign on (okta): you are not allowed to access this app

I have a very simple Django test app running to try and integrate SSO using Okta as IDP. I am using the Django-saml2-auth library for django sso.

When I open the sso related pages im getting the following screen (you are not allowed to access this app): you are not allowed

My settings.py looks like this:

SAML2_AUTH = {
    'METADATA_LOCAL_FILE_PATH': [os.path.join(BASE_DIR, 'metadata.xml')],
    'ASSERTION_URL': 'http://localhost:8002',
    'ENTITY_ID': 'http://localhost:8002/django_saml2/acs/',
}

urls:

from django.contrib import admin
from django.conf.urls import url
from django.urls import path, include
import django_saml2_auth.views

urlpatterns = [
    url(r'^django_saml2/', include('django_saml2_auth.urls')),
    path('accounts/login/', django_saml2_auth.views.signin),
    path('admin/login/', django_saml2_auth.views.signin),

    path('admin/', admin.site.urls),
]

And Okta settings like this:

Okta settings

Any help would be very much appreciated.

Upvotes: 0

Views: 553

Answers (1)

martin genot
martin genot

Reputation: 23

Your METADATA_LOCAL_FILE_PATH in the settings file should be like this :

SAML2_AUTH = {
    'METADATA_LOCAL_FILE_PATH': os.path.join(BASE_DIR, 'metadata.xml'),
    'ASSERTION_URL': 'http://localhost:8002',
    'ENTITY_ID': 'http://localhost:8002/django_saml2/acs/',
}

Upvotes: 0

Related Questions