@nebulr-group/bridge-cli 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/auth/methods.command.d.ts +68 -0
- package/dist/commands/auth/methods.command.d.ts.map +1 -0
- package/dist/commands/auth/methods.command.js +91 -0
- package/dist/commands/auth/methods.command.js.map +1 -0
- package/dist/commands/auth.command.d.ts +1 -0
- package/dist/commands/auth.command.d.ts.map +1 -1
- package/dist/commands/auth.command.js +3 -0
- package/dist/commands/auth.command.js.map +1 -1
- package/dist/commands/journeys.js +1 -1
- package/dist/commands/journeys.js.map +1 -1
- package/dist/commands/setup.command.d.ts +1 -1
- package/dist/prompts/decisions/login.md +3 -2
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `bridge auth methods list|enable|disable <method>` — TBP-547.
|
|
3
|
+
*
|
|
4
|
+
* One view of every login method and one verb to switch any of them.
|
|
5
|
+
*
|
|
6
|
+
* - `list` prints the same `loginMethods` object as the MCP tool
|
|
7
|
+
* get_auth_config, from the same `app.get()` that `bridge auth config` and
|
|
8
|
+
* `bridge info auth-config` read, so the three never disagree.
|
|
9
|
+
* - `enable` / `disable` flip the one app switch behind the method. Social
|
|
10
|
+
* providers keep their saved credentials when switched off, so switching
|
|
11
|
+
* them back on needs no new setup.
|
|
12
|
+
* - Bridge itself refuses a social provider with no credentials yet
|
|
13
|
+
* (SIGN_IN_CREDENTIALS_MISSING) and the last remaining sign-in method
|
|
14
|
+
* (LAST_SIGN_IN_METHOD); its code and fix come through as the error.
|
|
15
|
+
* - Password has no switch on Bridge: it is listed as always available, and
|
|
16
|
+
* enabling or disabling it is refused here with that reason.
|
|
17
|
+
*/
|
|
18
|
+
import type { Command } from 'commander';
|
|
19
|
+
type AppSwitch = 'magicLinkEnabled' | 'passkeysEnabled' | 'mfaEnabled' | 'googleSsoEnabled' | 'linkedinSsoEnabled' | 'azureAdSsoEnabled' | 'appleSsoEnabled' | 'githubSsoEnabled' | 'facebookSsoEnabled';
|
|
20
|
+
/** Method name → the app switch behind it. Names match get_auth_config. */
|
|
21
|
+
export declare const METHOD_SWITCHES: Readonly<Record<string, AppSwitch>>;
|
|
22
|
+
export declare const METHOD_NAMES: string[];
|
|
23
|
+
type AppLike = Partial<Record<AppSwitch, boolean>>;
|
|
24
|
+
/** The `loginMethods` object get_auth_config returns — kept identical on purpose. */
|
|
25
|
+
export declare function loginMethods(app: AppLike): {
|
|
26
|
+
password: {
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
note: string;
|
|
29
|
+
};
|
|
30
|
+
magicLink: {
|
|
31
|
+
enabled: boolean | undefined;
|
|
32
|
+
};
|
|
33
|
+
passkeys: {
|
|
34
|
+
enabled: boolean | undefined;
|
|
35
|
+
};
|
|
36
|
+
mfa: {
|
|
37
|
+
enabled: boolean | undefined;
|
|
38
|
+
note: string;
|
|
39
|
+
};
|
|
40
|
+
socialProviders: {
|
|
41
|
+
google: {
|
|
42
|
+
enabled: boolean | undefined;
|
|
43
|
+
};
|
|
44
|
+
linkedin: {
|
|
45
|
+
enabled: boolean | undefined;
|
|
46
|
+
};
|
|
47
|
+
azureAd: {
|
|
48
|
+
enabled: boolean | undefined;
|
|
49
|
+
};
|
|
50
|
+
apple: {
|
|
51
|
+
enabled: boolean | undefined;
|
|
52
|
+
};
|
|
53
|
+
github: {
|
|
54
|
+
enabled: boolean | undefined;
|
|
55
|
+
};
|
|
56
|
+
facebook: {
|
|
57
|
+
enabled: boolean | undefined;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
/** Accepts the canonical name in any case, and kebab/snake forms (magic-link). */
|
|
62
|
+
export declare function resolveMethod(input: string): {
|
|
63
|
+
method: string;
|
|
64
|
+
field: AppSwitch;
|
|
65
|
+
};
|
|
66
|
+
export declare function registerAuthMethodsCommands(auth: Command): void;
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=methods.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.command.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/methods.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,KAAK,SAAS,GACV,kBAAkB,GAClB,iBAAiB,GACjB,YAAY,GACZ,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,GACnB,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,CAAC;AAEzB,2EAA2E;AAC3E,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAU/D,CAAC;AAEF,eAAO,MAAM,YAAY,UAAgD,CAAC;AAE1E,KAAK,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;AAEnD,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAexC;AAQD,kFAAkF;AAClF,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAkBjF;AAYD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAgC/D"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { getManagementClient } from '../../config.js';
|
|
2
|
+
import { outputSuccess, outputError } from '../../output.js';
|
|
3
|
+
/** Method name → the app switch behind it. Names match get_auth_config. */
|
|
4
|
+
export const METHOD_SWITCHES = {
|
|
5
|
+
magicLink: 'magicLinkEnabled',
|
|
6
|
+
passkeys: 'passkeysEnabled',
|
|
7
|
+
mfa: 'mfaEnabled',
|
|
8
|
+
google: 'googleSsoEnabled',
|
|
9
|
+
linkedin: 'linkedinSsoEnabled',
|
|
10
|
+
azureAd: 'azureAdSsoEnabled',
|
|
11
|
+
apple: 'appleSsoEnabled',
|
|
12
|
+
github: 'githubSsoEnabled',
|
|
13
|
+
facebook: 'facebookSsoEnabled',
|
|
14
|
+
};
|
|
15
|
+
export const METHOD_NAMES = ['password', ...Object.keys(METHOD_SWITCHES)];
|
|
16
|
+
/** The `loginMethods` object get_auth_config returns — kept identical on purpose. */
|
|
17
|
+
export function loginMethods(app) {
|
|
18
|
+
return {
|
|
19
|
+
password: { enabled: true, note: 'Always available on Bridge' },
|
|
20
|
+
magicLink: { enabled: app.magicLinkEnabled },
|
|
21
|
+
passkeys: { enabled: app.passkeysEnabled },
|
|
22
|
+
mfa: { enabled: app.mfaEnabled, note: 'Second factor, not a standalone login method' },
|
|
23
|
+
socialProviders: {
|
|
24
|
+
google: { enabled: app.googleSsoEnabled },
|
|
25
|
+
linkedin: { enabled: app.linkedinSsoEnabled },
|
|
26
|
+
azureAd: { enabled: app.azureAdSsoEnabled },
|
|
27
|
+
apple: { enabled: app.appleSsoEnabled },
|
|
28
|
+
github: { enabled: app.githubSsoEnabled },
|
|
29
|
+
facebook: { enabled: app.facebookSsoEnabled },
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
class AuthMethodError extends Error {
|
|
34
|
+
code;
|
|
35
|
+
hint;
|
|
36
|
+
constructor(message, code, hint) {
|
|
37
|
+
super(message);
|
|
38
|
+
this.code = code;
|
|
39
|
+
this.hint = hint;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** Accepts the canonical name in any case, and kebab/snake forms (magic-link). */
|
|
43
|
+
export function resolveMethod(input) {
|
|
44
|
+
const wanted = input.replace(/[-_\s]/g, '').toLowerCase();
|
|
45
|
+
const method = METHOD_NAMES.find((m) => m.toLowerCase() === wanted);
|
|
46
|
+
if (method === 'password') {
|
|
47
|
+
throw new AuthMethodError('Password sign-in has no switch on Bridge: it is always available, so it cannot be enabled or disabled.', 'PASSWORD_ALWAYS_ON', `To change how people sign in, switch one of these instead: ${Object.keys(METHOD_SWITCHES).join(', ')}.`);
|
|
48
|
+
}
|
|
49
|
+
if (!method) {
|
|
50
|
+
throw new AuthMethodError(`Unknown login method "${input}".`, 'UNKNOWN_AUTH_METHOD', `Use one of: ${Object.keys(METHOD_SWITCHES).join(', ')}. \`bridge auth methods list\` shows them all.`);
|
|
51
|
+
}
|
|
52
|
+
return { method, field: METHOD_SWITCHES[method] };
|
|
53
|
+
}
|
|
54
|
+
async function setMethod(input, enabled) {
|
|
55
|
+
try {
|
|
56
|
+
const { method, field } = resolveMethod(input);
|
|
57
|
+
const app = (await getManagementClient().app.update({ [field]: enabled }));
|
|
58
|
+
outputSuccess({ method, enabled: app[field] === true, loginMethods: loginMethods(app) });
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
outputError(err);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export function registerAuthMethodsCommands(auth) {
|
|
65
|
+
const methods = auth
|
|
66
|
+
.command('methods')
|
|
67
|
+
.description('Every login method in one place: list them, switch one on or off');
|
|
68
|
+
methods
|
|
69
|
+
.command('list')
|
|
70
|
+
.description('List every login method and whether it is on (same as the MCP tool get_auth_config)')
|
|
71
|
+
.action(async () => {
|
|
72
|
+
try {
|
|
73
|
+
const app = (await getManagementClient().app.get());
|
|
74
|
+
outputSuccess({ loginMethods: loginMethods(app) });
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
outputError(err);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
methods
|
|
81
|
+
.command('enable <method>')
|
|
82
|
+
.description(`Switch a login method on (${Object.keys(METHOD_SWITCHES).join(', ')}). ` +
|
|
83
|
+
'A social provider needs its credentials first: bridge setup sso --provider <p>')
|
|
84
|
+
.action((method) => setMethod(method, true));
|
|
85
|
+
methods
|
|
86
|
+
.command('disable <method>')
|
|
87
|
+
.description('Switch a login method off. A social provider keeps its credentials, so enable switches it back on. ' +
|
|
88
|
+
'Bridge refuses to switch off the last remaining sign-in method.')
|
|
89
|
+
.action((method) => setMethod(method, false));
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=methods.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.command.js","sourceRoot":"","sources":["../../../src/commands/auth/methods.command.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAa7D,2EAA2E;AAC3E,MAAM,CAAC,MAAM,eAAe,GAAwC;IAClE,SAAS,EAAE,kBAAkB;IAC7B,QAAQ,EAAE,iBAAiB;IAC3B,GAAG,EAAE,YAAY;IACjB,MAAM,EAAE,kBAAkB;IAC1B,QAAQ,EAAE,oBAAoB;IAC9B,OAAO,EAAE,mBAAmB;IAC5B,KAAK,EAAE,iBAAiB;IACxB,MAAM,EAAE,kBAAkB;IAC1B,QAAQ,EAAE,oBAAoB;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;AAI1E,qFAAqF;AACrF,MAAM,UAAU,YAAY,CAAC,GAAY;IACvC,OAAO;QACL,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,4BAA4B,EAAE;QAC/D,SAAS,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,gBAAgB,EAAE;QAC5C,QAAQ,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,eAAe,EAAE;QAC1C,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,8CAA8C,EAAE;QACtF,eAAe,EAAE;YACf,MAAM,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,gBAAgB,EAAE;YACzC,QA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V,6BAA6B,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;QACvE,gFAAgF,CACnF;SACA,MAAM,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IAEvD,OAAO;SACJ,OAAO,CAAC,kBAAkB,CAAC;SAC3B,WAAW,CACV,qGAAqG;QACnG,iEAAiE,CACpE;SACA,MAAM,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* - `status` (TBP-113): show current login state.
|
|
8
8
|
* - `use` (TBP-628): switch the default app, offline.
|
|
9
9
|
* - `config`/`mfa`/`password-policy`: pre-existing app auth-config commands.
|
|
10
|
+
* - `methods` (TBP-547): list every login method, switch any one.
|
|
10
11
|
*/
|
|
11
12
|
import type { Command } from 'commander';
|
|
12
13
|
export declare function registerAuthCommands(program: Command): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.command.d.ts","sourceRoot":"","sources":["../../src/commands/auth.command.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"auth.command.d.ts","sourceRoot":"","sources":["../../src/commands/auth.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkB3D"}
|
|
@@ -3,6 +3,7 @@ import { registerAuthLogoutCommand } from './auth/logout.command.js';
|
|
|
3
3
|
import { registerAuthStatusCommand } from './auth/status.command.js';
|
|
4
4
|
import { registerAuthUseCommand } from './auth/use.command.js';
|
|
5
5
|
import { registerAuthConfigCommands } from './auth/config.command.js';
|
|
6
|
+
import { registerAuthMethodsCommands } from './auth/methods.command.js';
|
|
6
7
|
export function registerAuthCommands(program) {
|
|
7
8
|
const auth = program
|
|
8
9
|
.command('auth')
|
|
@@ -15,5 +16,7 @@ export function registerAuthCommands(program) {
|
|
|
15
16
|
registerAuthUseCommand(auth);
|
|
16
17
|
// Pre-existing — app-level auth configuration.
|
|
17
18
|
registerAuthConfigCommands(auth);
|
|
19
|
+
// TBP-547 — every login method in one place.
|
|
20
|
+
registerAuthMethodsCommands(auth);
|
|
18
21
|
}
|
|
19
22
|
//# sourceMappingURL=auth.command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.command.js","sourceRoot":"","sources":["../../src/commands/auth.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.command.js","sourceRoot":"","sources":["../../src/commands/auth.command.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAExE,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO;SACjB,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,4DAA4D,CAAC,CAAC;IAE7E,qCAAqC;IACrC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAC/B,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAChC,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAEhC,4EAA4E;IAC5E,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAE7B,+CAA+C;IAC/C,0BAA0B,CAAC,IAAI,CAAC,CAAC;IAEjC,6CAA6C;IAC7C,2BAA2B,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -28,7 +28,7 @@ export const JOURNEYS = [
|
|
|
28
28
|
steps: [
|
|
29
29
|
'Goal: users can sign up and sign in to this app through the Bridge.',
|
|
30
30
|
'Read the current setup with `bridge app get` and `bridge auth config`.',
|
|
31
|
-
'
|
|
31
|
+
'See every sign-in method with `bridge auth methods list`; ask the developer which they want, then `bridge auth methods enable|disable`. A social provider needs its credentials first: `bridge setup sso`.',
|
|
32
32
|
'Register the callback URL with `bridge app redirect-uris add` (never replace the list).',
|
|
33
33
|
'Prove it works at the end: `bridge test-user create`, then `bridge test-user verify`.',
|
|
34
34
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journeys.js","sourceRoot":"","sources":["../../src/commands/journeys.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;;;;;;;GAQG;AAEH,kEAAkE;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY;CAC/E,CAAC;AAgBX,MAAM,iBAAiB,GACrB,0GAA0G;IAC1G,4GAA4G,CAAC;AAE/G,MAAM,CAAC,MAAM,QAAQ,GAAc;IACjC;QACE,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE,OAAO;QACf,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,MAAM;QACf,KAAK,EAAE;YACL,qEAA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AAC;gBAC/F,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO;oBAC/B,CAAC,CAAC,CAAC,MAAM,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,IAAI;oBAC5E,CAAC,CAAC,IAAI,CAAC;gBACT,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;gBACnE,IAAI,IAAI,CAAC,IAAI;oBAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;;oBAClC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACpC,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,WAAW,CAAC,GAAG,CAAC,CAAC;YACnB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -42,7 +42,7 @@ export interface SetupSsoOptions {
|
|
|
42
42
|
discoveryUrl?: string;
|
|
43
43
|
}
|
|
44
44
|
export declare function setupSso(opts: SetupSsoOptions): Promise<{
|
|
45
|
-
provider: "google" | "
|
|
45
|
+
provider: "google" | "linkedin" | "github" | "facebook" | "azure";
|
|
46
46
|
enabled: boolean;
|
|
47
47
|
callbackUrl: string;
|
|
48
48
|
app: import("@nebulr-group/bridge-auth-core").AppResponse;
|
|
@@ -44,14 +44,15 @@ Apply these without asking. Say the reason in one line.
|
|
|
44
44
|
|
|
45
45
|
| Step | MCP | CLI |
|
|
46
46
|
|---|---|---|
|
|
47
|
-
|
|
|
47
|
+
| See every login method and whether it is on | `get_auth_config` | `bridge auth methods list` |
|
|
48
|
+
| Turn magic link, passkeys, two-factor or a social provider on or off | `update_auth_methods` | `bridge auth methods enable magicLink` / `bridge auth methods disable google` |
|
|
48
49
|
| Add a social provider with its credentials | `setup_sso` | `bridge setup sso --provider google --client-id … --client-secret …` |
|
|
49
50
|
| Register the callback URL | `add_redirect_uri` | `bridge app redirect-uris add <url>` |
|
|
50
51
|
| Set UI URL, default callback, allowed origins | `update_app` | `bridge app update --ui-url … --default-callback-uri … --allowed-origins …` |
|
|
51
52
|
| Change token lifetimes (seconds) | `update_password_policy` | `bridge auth password-policy --access-token-ttl 900` |
|
|
52
53
|
| Code for the framework | `get_integration_guide` (topic `auth`) | `bridge guide svelte` (hosted) or `bridge guide svelte sdk-auth` (in-app) |
|
|
53
54
|
|
|
54
|
-
`setup_sso` returns a callback URL. The developer must paste it into the provider's console, or that provider's sign-in fails with a redirect mismatch. Always show it to them with that instruction. `update_auth_methods`
|
|
55
|
+
`setup_sso` returns a callback URL. The developer must paste it into the provider's console, or that provider's sign-in fails with a redirect mismatch. Always show it to them with that instruction. `update_auth_methods` / `bridge auth methods` never save credentials: Bridge refuses to switch a social provider on until they are saved, and switching one off keeps them. Bridge also refuses to switch off the last remaining sign-in method.
|
|
55
56
|
|
|
56
57
|
## Prove it
|
|
57
58
|
|