Skip to content

Commit 8ee935e

Browse files
zxan1285fyockm
authored andcommitted
custom domains fix for appliances (#47)
1 parent ff8e661 commit 8ee935e

File tree

6 files changed

+984
-944
lines changed

6 files changed

+984
-944
lines changed

client/actions/auth.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@ import jwtDecode from 'jwt-decode';
44

55
import * as constants from '../constants';
66

7-
const webAuth = new auth0.WebAuth({ // eslint-disable-line no-undef
8-
domain: window.config.AUTH0_DOMAIN,
7+
const webAuthOptions = {
8+
domain: window.config.AUTH0_CUSTOM_DOMAIN,
99
clientID: window.config.AUTH0_CLIENT_ID,
1010
responseType: 'id_token token',
1111
scope: 'openid name email nickname read:applications',
1212
audience: 'urn:auth0-sso-dashboard'
13-
});
13+
};
14+
15+
if (window.config.IS_APPLIANCE) {
16+
webAuthOptions.overrides = {
17+
__tenant: window.config.AUTH0_DOMAIN.split('.')[0],
18+
__token_issuer: `https://${window.config.AUTH0_DOMAIN}/`
19+
};
20+
}
21+
22+
const webAuth = new auth0.WebAuth(webAuthOptions); // eslint-disable-line no-undef
1423

1524
export function login() {
1625
if (!window.location.hash) {

client/components/Applications/ApplicationsList.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default class ApplicationsList extends Component {
2525
const name = app.name || appId;
2626

2727
const link = app.customURLEnabled ? varstring(app.customURL || '', {
28-
domain: window.config.AUTH0_DOMAIN,
28+
domain: window.config.AUTH0_CUSTOM_DOMAIN,
2929
connection: app.connection,
3030
client_id: app.client,
3131
callback: app.callback

0 commit comments

Comments
 (0)