Skip to content

Commit

Permalink
feat: [PMA-98] add urls for Saml athentefication through mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroNefyodov committed Jan 23, 2025
1 parent 1e519ce commit 7ce5ebb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
18 changes: 17 additions & 1 deletion common/djangoapps/third_party_auth/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,31 @@
post_to_custom_auth_form,
saml_metadata_view
)
from mobile_api_extensions.views import (
auth_mobile,
complete_mobile,
redirect_to_mobile_deeplink,
redirect_to_mobile,
)

urlpatterns = [
path('auth/inactive', inactive_user_view, name="third_party_inactive_redirect"),
path('auth/custom_auth_entry', post_to_custom_auth_form, name='tpa_post_to_custom_auth_form'),
re_path(r'^auth/saml/metadata.xml', saml_metadata_view),
re_path(r'^auth/login/(?P<backend>lti)/$', lti_login_and_complete_view),
path('auth/idp_redirect/<slug:provider_slug>', IdPRedirectView.as_view(), name="idp_redirect"),
path('auth/', include('social_django.urls', namespace='social')),
path('auth/saml/v0/', include('common.djangoapps.third_party_auth.samlproviderconfig.urls')),
path('auth/saml/v0/', include('common.djangoapps.third_party_auth.samlproviderdata.urls')),
path('auth/saml/v0/', include('common.djangoapps.third_party_auth.saml_configuration.urls')),
]

urlpatterns += [
re_path(r'^auth/login/(?P<backend>[^/]+)/$', auth_mobile, name='social_login_override'),
re_path(r'^auth/complete/(?P<backend>[^/]+)/$',
complete_mobile,
name='social_complete_override'
),
path('auth/', include('social_django.urls', namespace='social')),
path('sso_deeplink', redirect_to_mobile_deeplink, name='sso-deeplink'),
re_path(r'^auth/login/mobile/(?P<backend_name>[^/]+)/$', redirect_to_mobile, name='redirect-mobile'),
]
12 changes: 12 additions & 0 deletions openedx/core/djangoapps/oauth_dispatch/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
from django.urls import path, re_path
from django.views.decorators.csrf import csrf_exempt

from mobile_api_extensions.views import AuthorizationCodeExchangeView
from mobile_api_extensions.utils import is_enabled_mobile

from . import views

urlpatterns = [
Expand All @@ -21,3 +24,12 @@
name='exchange_access_token',
),
]

if is_enabled_mobile():
urlpatterns.append(
re_path(
r'^exchange_authorization_code/?$',
csrf_exempt(AuthorizationCodeExchangeView.as_view()),
name='exchange_authorization_code',
)
)

0 comments on commit 7ce5ebb

Please sign in to comment.