Skip to content

Commit 6500eef

Browse files
authored
Merge pull request #350 from april/master
Change LDAP check from CISv1 to CISv2
2 parents 020ba71 + 313c1f6 commit 6500eef

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

config/development.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"auth0_domain": "auth-dev.mozilla.auth0.com",
44
"cdn_domain": "cdn.sso.allizom.org",
55
"LDAP_connection_name": "Mozilla-LDAP-Dev",
6-
"person_api_domain": "https://person-api.sso.allizom.org/v1/connection/",
6+
"person_api_domain": "person.api.test.sso.allizom.org",
77
"logout_url": "https://auth-dev.mozilla.auth0.com/v2/logout?returnTo=https://sso.allizom.org/signout.html",
88
"sso_dashboard_url": "https://sso.allizom.org",
99
"GTM_ID": "GTM-T2N2BRW",
@@ -14,7 +14,7 @@
1414
"maintenance_mode": "false"
1515
},
1616
"supportedLoginMethods": [ "github", "google-oauth2", "firefoxaccounts", "email" ],
17-
"csp": "default-src 'none'; connect-src 'self' https://person-api.sso.allizom.org; script-src 'self' https://cdn.sso.allizom.org https://www.googletagmanager.com https://www.google-analytics.com; style-src 'self' https://cdn.sso.allizom.org; font-src 'self' https://cdn.sso.allizom.org; img-src 'self' https://cdn.sso.allizom.org https://www.google-analytics.com",
17+
"csp": "default-src 'none'; connect-src 'self' https://person.api.test.sso.allizom.org; script-src 'self' https://cdn.sso.allizom.org https://www.googletagmanager.com https://www.google-analytics.com; style-src 'self' https://cdn.sso.allizom.org; font-src 'self' https://cdn.sso.allizom.org; img-src 'self' https://cdn.sso.allizom.org https://www.google-analytics.com",
1818
"displayNames": {
1919
"github": "GitHub",
2020
"google-oauth2": "Google",

config/local.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"auth0_domain": "auth-dev.mozilla.auth0.com",
44
"cdn_domain": "localhost:3000",
55
"LDAP_connection_name": "Mozilla-LDAP-Dev",
6-
"person_api_domain": "https://person-api.sso.allizom.org/v1/connection/",
6+
"person_api_domain": "person.api.dev.sso.allizom.org",
77
"logout_url": "https://auth-dev.mozilla.auth0.com/v2/logout?returnTo=https://sso.allizom.org/signout.html",
88
"sso_dashboard_url": "https://sso.allizom.org",
99
"GTM_ID": "GTM-T2N2BRW",

config/production.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"auth0_domain": "auth.mozilla.auth0.com",
44
"cdn_domain": "cdn.sso.mozilla.com",
55
"LDAP_connection_name": "Mozilla-LDAP",
6-
"person_api_domain": "https://person-api.sso.mozilla.com/v1/connection/",
6+
"person_api_domain": "person.api.sso.mozilla.com",
77
"logout_url": "https://auth.mozilla.auth0.com/v2/logout?returnTo=https://sso.mozilla.com/signout.html",
88
"sso_dashboard_url": "https://sso.mozilla.com",
99
"GTM_ID": "GTM-T2N2BRW",
@@ -13,7 +13,7 @@
1313
"maintenance_mode": "false"
1414
},
1515
"supportedLoginMethods": [ "github", "google-oauth2", "firefoxaccounts", "email" ],
16-
"csp": "default-src 'none'; connect-src 'self' https://person-api.sso.mozilla.com; script-src 'self' https://cdn.sso.mozilla.com https://www.googletagmanager.com https://www.google-analytics.com; style-src 'self' https://cdn.sso.mozilla.com; font-src 'self' https://cdn.sso.mozilla.com; img-src 'self' https://cdn.sso.mozilla.com https://www.google-analytics.com",
16+
"csp": "default-src 'none'; connect-src 'self' https://person.api.sso.mozilla.com; script-src 'self' https://cdn.sso.mozilla.com https://www.googletagmanager.com https://www.google-analytics.com; style-src 'self' https://cdn.sso.mozilla.com; font-src 'self' https://cdn.sso.mozilla.com; img-src 'self' https://cdn.sso.mozilla.com https://www.google-analytics.com",
1717
"displayNames": {
1818
"github": "GitHub",
1919
"google-oauth2": "Google",

src/html/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<title>Mozilla Login</title>
4949
<meta name="viewport" content="width=device-width, initial-scale=1">
5050
<meta http-equiv="Content-Security-Policy" content="{{{ csp }}}">
51-
<link rel="dns-prefetch" href="{{{ person_api_domain }}}">
51+
<link rel="dns-prefetch" href="https://{{{ person_api_domain }}}">
5252
<link rel="stylesheet" href="{{{ cdn }}}/css/fonts.css" type="text/css" />
5353
<link rel="stylesheet" href="{{{ cdn }}}/css/styles.css" type="text/css" />
5454
<link rel="icon" href="{{{ cdn }}}/images/favicon.png" type="image/png" sizes="192x192" />

src/js/handlers/enter.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = function enter( element ) {
2929
var qualifiesForLDAPShortcut = /@(mozilla\.com|getpocket\.com|mozillafoundation\.org)$/.test( emailField.value );
3030
var supportedByRP = form.loginMethods ? form.loginMethods['supportedByRP'] : null;
3131
var onlyAcceptsLDAP = supportedByRP && supportedByRP.length === 1 && supportedByRP.indexOf( NLX.LDAP_connection_name ) === 0;
32-
var ENDPOINT = NLX.person_api_domain;
32+
var ENDPOINT = 'https://' + NLX.person_api_domain + '/v2/user/metadata/';
3333

3434
if ( emailField.value === '' || emailField.validity.valid === false ) {
3535
emailField.focus();
@@ -47,11 +47,8 @@ module.exports = function enter( element ) {
4747
fetch( ENDPOINT + emailFieldValue )
4848
.then(
4949
function( response ) {
50-
response.json().then( function( data ) {
51-
var userinfo = JSON.parse( data );
52-
var isLDAP = userinfo.hasOwnProperty( 'user_email' ) && userinfo.hasOwnProperty( 'connection_method' ) && userinfo[ 'connection_method' ] === 'ad';
53-
54-
if ( isLDAP ) {
50+
response.json().then( function( userinfo ) {
51+
if ( userinfo.exists.ldap ) {
5552
showLDAP( element, passwordField );
5653
}
5754
else {

0 commit comments

Comments
 (0)