Skip to content

Commit b7c72ed

Browse files
authored
Merge pull request #35 from akatsoulas/better-url-naming
Simplify naming schema for urls.
2 parents 75341f4 + 52e5d80 commit b7c72ed

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

mozilla_django_oidc/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from mozilla_django_oidc import views
44

55
urlpatterns = [
6-
url(r'^oidc/authentication_callback/$', views.OIDCAuthenticationCallbackView.as_view(),
6+
url(r'^callback/$', views.OIDCAuthenticationCallbackView.as_view(),
77
name='oidc_authentication_callback'),
8-
url(r'^oidc/authentication_init/$', views.OIDCAuthenticationRequestView.as_view(),
8+
url(r'^authenticate/$', views.OIDCAuthenticationRequestView.as_view(),
99
name='oidc_authentication_init'),
1010
]

tests/test_auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def test_successful_authentication_existing_user(self, token_mock, request_mock)
7777
'client_secret': 'example_secret',
7878
'grant_type': 'authorization_code',
7979
'code': 'foo',
80-
'redirect_uri': 'http://site-url.com/oidc/authentication_callback/'
80+
'redirect_uri': 'http://site-url.com/callback/'
8181
}
8282
self.assertEqual(self.backend.authenticate(code='foo', state='bar'), user)
8383
token_mock.assert_called_once_with('id_token')
@@ -112,7 +112,7 @@ def test_successful_authentication_new_user(self, token_mock, request_mock):
112112
'client_secret': 'example_secret',
113113
'grant_type': 'authorization_code',
114114
'code': 'foo',
115-
'redirect_uri': 'http://site-url.com/oidc/authentication_callback/',
115+
'redirect_uri': 'http://site-url.com/callback/',
116116
}
117117
self.assertEqual(User.objects.all().count(), 0)
118118
self.backend.authenticate(code='foo', state='bar')

tests/test_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def test_get(self, mock_random_string):
128128
'response_type': ['code'],
129129
'scope': ['openid'],
130130
'client_id': ['example_id'],
131-
'redirect_uri': ['http://site-url.com/oidc/authentication_callback/'],
131+
'redirect_uri': ['http://site-url.com/callback/'],
132132
'state': ['examplestring']
133133
}
134134
self.assertDictEqual(parse_qs(o.query), expected_query)

0 commit comments

Comments
 (0)