Skip to content

Commit

Permalink
Merge pull request #35 from akatsoulas/better-url-naming
Browse files Browse the repository at this point in the history
Simplify naming schema for urls.
  • Loading branch information
akatsoulas committed Oct 31, 2016
2 parents 75341f4 + 52e5d80 commit b7c72ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mozilla_django_oidc/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from mozilla_django_oidc import views

urlpatterns = [
url(r'^oidc/authentication_callback/$', views.OIDCAuthenticationCallbackView.as_view(),
url(r'^callback/$', views.OIDCAuthenticationCallbackView.as_view(),
name='oidc_authentication_callback'),
url(r'^oidc/authentication_init/$', views.OIDCAuthenticationRequestView.as_view(),
url(r'^authenticate/$', views.OIDCAuthenticationRequestView.as_view(),
name='oidc_authentication_init'),
]
4 changes: 2 additions & 2 deletions tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_successful_authentication_existing_user(self, token_mock, request_mock)
'client_secret': 'example_secret',
'grant_type': 'authorization_code',
'code': 'foo',
'redirect_uri': 'http://site-url.com/oidc/authentication_callback/'
'redirect_uri': 'http://site-url.com/callback/'
}
self.assertEqual(self.backend.authenticate(code='foo', state='bar'), user)
token_mock.assert_called_once_with('id_token')
Expand Down Expand Up @@ -112,7 +112,7 @@ def test_successful_authentication_new_user(self, token_mock, request_mock):
'client_secret': 'example_secret',
'grant_type': 'authorization_code',
'code': 'foo',
'redirect_uri': 'http://site-url.com/oidc/authentication_callback/',
'redirect_uri': 'http://site-url.com/callback/',
}
self.assertEqual(User.objects.all().count(), 0)
self.backend.authenticate(code='foo', state='bar')
Expand Down
2 changes: 1 addition & 1 deletion tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_get(self, mock_random_string):
'response_type': ['code'],
'scope': ['openid'],
'client_id': ['example_id'],
'redirect_uri': ['http://site-url.com/oidc/authentication_callback/'],
'redirect_uri': ['http://site-url.com/callback/'],
'state': ['examplestring']
}
self.assertDictEqual(parse_qs(o.query), expected_query)
Expand Down

0 comments on commit b7c72ed

Please sign in to comment.