Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
60f4f1ac
Commit
60f4f1ac
authored
Mar 29, 2016
by
Braden MacDonald
Committed by
Adam Palay
Apr 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Azure AD third party auth provider by default
parent
c5072d63
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
0 deletions
+58
-0
common/djangoapps/third_party_auth/tests/specs/test_azuread.py
+46
-0
common/djangoapps/third_party_auth/tests/testutil.py
+10
-0
lms/envs/aws.py
+1
-0
lms/envs/test.py
+1
-0
No files found.
common/djangoapps/third_party_auth/tests/specs/test_azuread.py
0 → 100644
View file @
60f4f1ac
"""Integration tests for Azure Active Directory / Microsoft Account provider."""
from
third_party_auth.tests.specs
import
base
# pylint: disable=test-inherits-tests
class
AzureADOauth2IntegrationTest
(
base
.
Oauth2IntegrationTest
):
"""Integration tests for Azure Active Directory / Microsoft Account provider."""
def
setUp
(
self
):
super
(
AzureADOauth2IntegrationTest
,
self
)
.
setUp
()
self
.
provider
=
self
.
configure_azure_ad_provider
(
enabled
=
True
,
key
=
'azure_ad_oauth2_key'
,
secret
=
'azure_ad_oauth2_secret'
,
)
TOKEN_RESPONSE_DATA
=
{
'exp'
:
1234590302
,
'nbf'
:
1234586402
,
'iat'
:
1234586402
,
'expires_on'
:
'1234590302'
,
'ver'
:
'1.0'
,
'access_token'
:
'access_token_value'
,
'expires_in'
:
'3599'
,
'id_token'
:
'id_token_value'
,
'token_type'
:
'Bearer'
,
'refresh_token'
:
'REFRESH1234567890'
,
'iss'
:
'https://sts.windows.net/abcdefgh-1234-5678-900a-0aa0a00aa0aa/'
,
'ipaddr'
:
'123.123.123.123'
,
}
USER_RESPONSE_DATA
=
{
'oid'
:
'abcdefgh-1234-5678-900a-0aa0a00aa0aa'
,
'aud'
:
'abcdefgh-1234-5678-900a-0aa0a00aa0aa'
,
'tid'
:
'abcdefgh-1234-5678-900a-0aa0a00aa0aa'
,
'amr'
:
[
'pwd'
],
'unique_name'
:
'email_value@example.com'
,
'upn'
:
'email_value@example.com'
,
'family_name'
:
'family_name_value'
,
'name'
:
'name_value'
,
'given_name'
:
'given_name_value'
,
'sub'
:
'aBC_ab12345678h94CSgP1lTYJCHATGQDAcfg8jSOck'
,
}
def
get_username
(
self
):
return
self
.
get_response_data
()
.
get
(
'name'
)
common/djangoapps/third_party_auth/tests/testutil.py
View file @
60f4f1ac
...
...
@@ -125,6 +125,16 @@ class ThirdPartyAuthTestMixin(object):
return
cls
.
configure_oauth_provider
(
**
kwargs
)
@classmethod
def
configure_azure_ad_provider
(
cls
,
**
kwargs
):
""" Update the settings for the Azure AD third party auth provider/backend """
kwargs
.
setdefault
(
"name"
,
"Azure AD"
)
kwargs
.
setdefault
(
"backend_name"
,
"azuread-oauth2"
)
kwargs
.
setdefault
(
"icon_class"
,
"fa-azuread"
)
kwargs
.
setdefault
(
"key"
,
"test"
)
kwargs
.
setdefault
(
"secret"
,
"test"
)
return
cls
.
configure_oauth_provider
(
**
kwargs
)
@classmethod
def
configure_twitter_provider
(
cls
,
**
kwargs
):
""" Update the settings for the Twitter third party auth provider/backend """
kwargs
.
setdefault
(
"name"
,
"Twitter"
)
...
...
lms/envs/aws.py
View file @
60f4f1ac
...
...
@@ -574,6 +574,7 @@ if FEATURES.get('ENABLE_THIRD_PARTY_AUTH'):
'social.backends.google.GoogleOAuth2'
,
'social.backends.linkedin.LinkedinOAuth2'
,
'social.backends.facebook.FacebookOAuth2'
,
'social.backends.azuread.AzureADOAuth2'
,
'third_party_auth.saml.SAMLAuthBackend'
,
'third_party_auth.lti.LTIAuthBackend'
,
])
+
list
(
AUTHENTICATION_BACKENDS
)
...
...
lms/envs/test.py
View file @
60f4f1ac
...
...
@@ -265,6 +265,7 @@ AUTHENTICATION_BACKENDS = (
'social.backends.google.GoogleOAuth2'
,
'social.backends.linkedin.LinkedinOAuth2'
,
'social.backends.facebook.FacebookOAuth2'
,
'social.backends.azuread.AzureADOAuth2'
,
'social.backends.twitter.TwitterOAuth'
,
'third_party_auth.dummy.DummyBackend'
,
'third_party_auth.saml.SAMLAuthBackend'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment