Skip to content

Commit eb5a654

Browse files
authored
fix(auth): use web app credentials for mobile ROPG refresh (#1444)
1 parent 3d84824 commit eb5a654

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

src/Config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ interface AUTH_CONFIG_SERVER_TYPE {
1212
issuer: string
1313
clientId: string
1414
clientSecret: string
15-
mobileClientId: string
1615
mgmtClientId: string
1716
mgmtClientSecret: string
1817
mgmtClientAudience: string
@@ -26,7 +25,6 @@ if (typeof window === 'undefined') {
2625
issuer: checkAndPrintWarning('AUTH0_DOMAIN', process.env.AUTH0_DOMAIN),
2726
clientId: checkAndPrintWarning('AUTH0_CLIENT_ID', process.env.AUTH0_CLIENT_ID),
2827
clientSecret: checkAndPrintWarning('AUTH0_CLIENT_SECRET', process.env.AUTH0_CLIENT_SECRET),
29-
mobileClientId: checkAndPrintWarning('AUTH0_MOBILE_CLIENT_ID', process.env.AUTH0_MOBILE_CLIENT_ID),
3028
mgmtClientId: checkAndPrintWarning('AUTH0_MGMT_CLIENT_ID', process.env.AUTH0_MGMT_CLIENT_ID),
3129
mgmtClientSecret: checkAndPrintWarning('AUTH0_MGMT_CLIENT_SECRET', process.env.AUTH0_MGMT_CLIENT_SECRET),
3230
mgmtClientAudience: checkAndPrintWarning('AUTH0_MGMT_CLIENT_AUDIENCE', process.env.AUTH0_MGMT_CLIENT_AUDIENCE),

src/js/auth/mobile.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,13 @@ import { AUTH_CONFIG_SERVER } from '../../Config'
44

55
if (AUTH_CONFIG_SERVER == null) throw new Error('AUTH_CONFIG_SERVER not defined')
66

7-
const mobileAuthSecret = process.env.MOBILE_AUTH_SECRET
8-
if (mobileAuthSecret == null) {
9-
console.warn('Mobile auth secret not found')
10-
}
11-
12-
const { mobileClientId, issuer } = AUTH_CONFIG_SERVER
7+
const { clientId, clientSecret, issuer } = AUTH_CONFIG_SERVER
138

14-
// Set up Auth0 client for mobile with client secret for ROPG flow
9+
// Set up Auth0 client for mobile ROPG using web app credentials (confidential client)
1510
export const auth0Client = new Auth0.AuthenticationClient({
1611
domain: issuer.replace('https://', ''),
17-
clientId: mobileClientId,
18-
clientSecret: mobileAuthSecret
12+
clientId,
13+
clientSecret
1914
})
2015

2116
export const isNullOrEmpty = (str: string | null | undefined): boolean => {

0 commit comments

Comments
 (0)