Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if logout_service_post is None:
_assertion_consumer_service = assertion_consumer_service
@require_POST
@csrf_exempt
def assertion_consumer_service(request, config_loader_path=None, attribute_mapping=None, create_unknown_user=None):
username_source = libsaml.conf.USERNAME_SOURCE.get().lower()
return _assertion_consumer_service(request, config_loader_path, attribute_mapping, create_unknown_user, username_source)
setattr(logout_service, 'login_notrequired', True)
setattr(login, 'login_notrequired', True)
setattr(echo_attributes, 'login_notrequired', True)
setattr(assertion_consumer_service, 'login_notrequired', True)
setattr(metadata, 'login_notrequired', True)
if logout_service_post is not None:
setattr(logout_service_post, 'login_notrequired', True)
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import django
from django.conf.urls import handler500, url
from djangosaml2 import views
urlpatterns = [
url(r'^login/$', views.login, name='saml2_login'),
url(r'^acs/$', views.assertion_consumer_service, name='saml2_acs'),
url(r'^logout/$', views.logout, name='saml2_logout'),
url(r'^ls/$', views.logout_service, name='saml2_ls'),
url(r'^ls/post/$', views.logout_service_post, name='saml2_ls_post'),
url(r'^metadata/$', views.metadata, name='saml2_metadata'),
]
if django.VERSION < (1, 8):
# django.conf.urls.patterns will be removed from django 1.10, so we
# import it here
from django.conf.urls import patterns
urlpatterns = patterns('', *urlpatterns)
handler500 = handler500
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from django.urls import path
from . import views
urlpatterns = [
path('login/', views.login, name='saml2_login'),
path('acs/', views.AssertionConsumerServiceView.as_view(), name='saml2_acs'),
path('logout/', views.logout, name='saml2_logout'),
path('ls/', views.logout_service, name='saml2_ls'),
path('ls/post/', views.logout_service_post, name='saml2_ls_post'),
path('metadata/', views.metadata, name='saml2_metadata'),
]
)
urlpatterns = [
url(
r'^api-auth/saml2/login/complete/$',
Saml2LoginCompleteView.as_view(),
name='saml2-login-complete',
),
url(r'^api-auth/saml2/login/$', Saml2LoginView.as_view(), name='saml2-login'),
url(
r'^api-auth/saml2/logout/complete/$',
Saml2LogoutCompleteView.as_view(),
name='saml2-logout-complete',
),
url(r'^api-auth/saml2/logout/$', Saml2LogoutView.as_view(), name='saml2-logout'),
url(r'^api-auth/saml2/metadata/$', metadata, name='saml2-metadata'),
url(
r'^api-auth/saml2/providers/$',
Saml2ProviderView.as_view(),
name='saml2-provider',
),