@greensecurity/javascript-sdk 0.45.0-beta.16 → 0.45.0-beta.17
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/commonjs/__tests__/vendors.test.js +1 -1
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +2 -9
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/usersPostAuthenticate.d.ts +37 -0
- package/dist/commonjs/funcs/usersPostAuthenticate.d.ts.map +1 -1
- package/dist/commonjs/funcs/usersPostAuthenticate.js +37 -0
- package/dist/commonjs/funcs/usersPostAuthenticate.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/authenticatesuccessresponse.d.ts +91 -0
- package/dist/commonjs/models/components/authenticatesuccessresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/authenticatesuccessresponse.js +100 -0
- package/dist/commonjs/models/components/authenticatesuccessresponse.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +2 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +2 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/loginemailandpassword.d.ts +34 -0
- package/dist/commonjs/models/components/loginemailandpassword.d.ts.map +1 -1
- package/dist/commonjs/models/components/loginemailandpassword.js +2 -0
- package/dist/commonjs/models/components/loginemailandpassword.js.map +1 -1
- package/dist/commonjs/models/components/loginrequirementsfromemail.d.ts +34 -0
- package/dist/commonjs/models/components/loginrequirementsfromemail.d.ts.map +1 -1
- package/dist/commonjs/models/components/loginrequirementsfromemail.js +2 -0
- package/dist/commonjs/models/components/loginrequirementsfromemail.js.map +1 -1
- package/dist/commonjs/models/components/mfarequiredresponse.d.ts +33 -0
- package/dist/commonjs/models/components/mfarequiredresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/mfarequiredresponse.js +2 -0
- package/dist/commonjs/models/components/mfarequiredresponse.js.map +1 -1
- package/dist/commonjs/models/components/passwordnotsetresponse.d.ts +34 -1
- package/dist/commonjs/models/components/passwordnotsetresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/passwordnotsetresponse.js +2 -0
- package/dist/commonjs/models/components/passwordnotsetresponse.js.map +1 -1
- package/dist/commonjs/models/components/passwordrequiredresponse.d.ts +33 -0
- package/dist/commonjs/models/components/passwordrequiredresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/passwordrequiredresponse.js +6 -0
- package/dist/commonjs/models/components/passwordrequiredresponse.js.map +1 -1
- package/dist/commonjs/models/components/samlloginrequiredresponse.d.ts +33 -0
- package/dist/commonjs/models/components/samlloginrequiredresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/samlloginrequiredresponse.js +2 -0
- package/dist/commonjs/models/components/samlloginrequiredresponse.js.map +1 -1
- package/dist/commonjs/models/components/ssocontinuation.d.ts +44 -0
- package/dist/commonjs/models/components/ssocontinuation.d.ts.map +1 -0
- package/dist/commonjs/models/components/ssocontinuation.js +56 -0
- package/dist/commonjs/models/components/ssocontinuation.js.map +1 -0
- package/dist/commonjs/models/operations/postauthenticate.d.ts +1 -1
- package/dist/commonjs/models/operations/postauthenticate.d.ts.map +1 -1
- package/dist/commonjs/models/operations/postauthenticate.js +1 -1
- package/dist/commonjs/models/operations/postauthenticate.js.map +1 -1
- package/dist/commonjs/react-query/usersPostAuthenticate.d.ts +37 -0
- package/dist/commonjs/react-query/usersPostAuthenticate.d.ts.map +1 -1
- package/dist/commonjs/react-query/usersPostAuthenticate.js +37 -0
- package/dist/commonjs/react-query/usersPostAuthenticate.js.map +1 -1
- package/dist/commonjs/sdk/users.d.ts +37 -0
- package/dist/commonjs/sdk/users.d.ts.map +1 -1
- package/dist/commonjs/sdk/users.js +37 -0
- package/dist/commonjs/sdk/users.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +1 -1
- package/dist/esm/__tests__/vendors.test.js.map +1 -1
- package/dist/esm/__tests__/webhooks.test.js +1 -1
- package/dist/esm/__tests__/webhooks.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +2 -9
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/usersPostAuthenticate.d.ts +37 -0
- package/dist/esm/funcs/usersPostAuthenticate.d.ts.map +1 -1
- package/dist/esm/funcs/usersPostAuthenticate.js +37 -0
- package/dist/esm/funcs/usersPostAuthenticate.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/authenticatesuccessresponse.d.ts +91 -0
- package/dist/esm/models/components/authenticatesuccessresponse.d.ts.map +1 -0
- package/dist/esm/models/components/authenticatesuccessresponse.js +61 -0
- package/dist/esm/models/components/authenticatesuccessresponse.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +2 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +2 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/loginemailandpassword.d.ts +34 -0
- package/dist/esm/models/components/loginemailandpassword.d.ts.map +1 -1
- package/dist/esm/models/components/loginemailandpassword.js +2 -0
- package/dist/esm/models/components/loginemailandpassword.js.map +1 -1
- package/dist/esm/models/components/loginrequirementsfromemail.d.ts +34 -0
- package/dist/esm/models/components/loginrequirementsfromemail.d.ts.map +1 -1
- package/dist/esm/models/components/loginrequirementsfromemail.js +2 -0
- package/dist/esm/models/components/loginrequirementsfromemail.js.map +1 -1
- package/dist/esm/models/components/mfarequiredresponse.d.ts +33 -0
- package/dist/esm/models/components/mfarequiredresponse.d.ts.map +1 -1
- package/dist/esm/models/components/mfarequiredresponse.js +2 -0
- package/dist/esm/models/components/mfarequiredresponse.js.map +1 -1
- package/dist/esm/models/components/passwordnotsetresponse.d.ts +34 -1
- package/dist/esm/models/components/passwordnotsetresponse.d.ts.map +1 -1
- package/dist/esm/models/components/passwordnotsetresponse.js +2 -0
- package/dist/esm/models/components/passwordnotsetresponse.js.map +1 -1
- package/dist/esm/models/components/passwordrequiredresponse.d.ts +33 -0
- package/dist/esm/models/components/passwordrequiredresponse.d.ts.map +1 -1
- package/dist/esm/models/components/passwordrequiredresponse.js +6 -0
- package/dist/esm/models/components/passwordrequiredresponse.js.map +1 -1
- package/dist/esm/models/components/samlloginrequiredresponse.d.ts +33 -0
- package/dist/esm/models/components/samlloginrequiredresponse.d.ts.map +1 -1
- package/dist/esm/models/components/samlloginrequiredresponse.js +2 -0
- package/dist/esm/models/components/samlloginrequiredresponse.js.map +1 -1
- package/dist/esm/models/components/ssocontinuation.d.ts +44 -0
- package/dist/esm/models/components/ssocontinuation.d.ts.map +1 -0
- package/dist/esm/models/components/ssocontinuation.js +19 -0
- package/dist/esm/models/components/ssocontinuation.js.map +1 -0
- package/dist/esm/models/operations/postauthenticate.d.ts +1 -1
- package/dist/esm/models/operations/postauthenticate.d.ts.map +1 -1
- package/dist/esm/models/operations/postauthenticate.js +1 -1
- package/dist/esm/models/operations/postauthenticate.js.map +1 -1
- package/dist/esm/react-query/usersPostAuthenticate.d.ts +37 -0
- package/dist/esm/react-query/usersPostAuthenticate.d.ts.map +1 -1
- package/dist/esm/react-query/usersPostAuthenticate.js +37 -0
- package/dist/esm/react-query/usersPostAuthenticate.js.map +1 -1
- package/dist/esm/sdk/users.d.ts +37 -0
- package/dist/esm/sdk/users.d.ts.map +1 -1
- package/dist/esm/sdk/users.js +37 -0
- package/dist/esm/sdk/users.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/vendors.test.ts +1 -1
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +2 -9
- package/src/funcs/usersPostAuthenticate.ts +37 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/authenticatesuccessresponse.ts +189 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/loginemailandpassword.ts +36 -0
- package/src/models/components/loginrequirementsfromemail.ts +36 -0
- package/src/models/components/mfarequiredresponse.ts +35 -0
- package/src/models/components/passwordnotsetresponse.ts +36 -1
- package/src/models/components/passwordrequiredresponse.ts +39 -0
- package/src/models/components/samlloginrequiredresponse.ts +35 -0
- package/src/models/components/ssocontinuation.ts +71 -0
- package/src/models/operations/postauthenticate.ts +2 -2
- package/src/react-query/usersPostAuthenticate.ts +37 -0
- package/src/sdk/users.ts +37 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passwordrequiredresponse.js","sourceRoot":"","sources":["../../../../src/models/components/passwordrequiredresponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"passwordrequiredresponse.js","sourceRoot":"","sources":["../../../../src/models/components/passwordrequiredresponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;AAgDnD,gBAAgB;AAChB,MAAM,CAAC,MAAM,sCAAsC,GAI/C,CAAC,CAAC,MAAM,CAAC;IACX,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;IACnC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;IACxB,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;CAC1C,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,WAAW,EAAE,UAAU;KACxB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,gCAAgC,CAC9C,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,sCAAsC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAClE,sDAAsD,CACvD,CAAC;AACJ,CAAC"}
|
|
@@ -20,6 +20,39 @@ export type SamlLoginRequiredResponse = {
|
|
|
20
20
|
* This is the URL that should be opened to initiate the SAML login flow
|
|
21
21
|
*/
|
|
22
22
|
ssoUrl: string;
|
|
23
|
+
/**
|
|
24
|
+
* Opaque, signed state that Green Security issues when a third-party service
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* provider starts a "Login with Green Security" SAML flow at
|
|
28
|
+
* `/saml/idp/sso`. The login screen receives it as the `sso_state` query
|
|
29
|
+
* string parameter and must pass it back, byte for byte, on every call to
|
|
30
|
+
* this endpoint for the remainder of the login journey — including the
|
|
31
|
+
* second call that carries an `mfa_code`.
|
|
32
|
+
*
|
|
33
|
+
* The blob is signed, not encrypted, and it expires five minutes after the
|
|
34
|
+
* service provider's request arrives. Do not parse it, shorten it, decode
|
|
35
|
+
* it, or re-encode it.
|
|
36
|
+
*
|
|
37
|
+
* **An invalid blob does not fail the login.** This is the opposite of what
|
|
38
|
+
* most integrators assume, so it is worth stating plainly: a forged, edited
|
|
39
|
+
* or expired `sso_state` is silently discarded, and the request then
|
|
40
|
+
* proceeds as an ordinary login. Valid credentials still authenticate and
|
|
41
|
+
* still return `200` — just with no `sso` object, leaving the user signed in
|
|
42
|
+
* to Green Security with no way back to the service provider that sent them.
|
|
43
|
+
* Never treat a `200` as proof that the SSO hand-off survived; check for
|
|
44
|
+
* `sso` explicitly.
|
|
45
|
+
*
|
|
46
|
+
* Every `202` response echoes the *verified* blob back in its own
|
|
47
|
+
* `sso_state` field. Always send back the value from the response you just
|
|
48
|
+
* received rather than the one you started with, so that a blob the server
|
|
49
|
+
* has already rejected is never resent, and so a client does not have to
|
|
50
|
+
* hold state of its own across the login journey.
|
|
51
|
+
*
|
|
52
|
+
* Omit this field entirely for an ordinary login that did not originate
|
|
53
|
+
* from a service provider.
|
|
54
|
+
*/
|
|
55
|
+
ssoState?: string | undefined;
|
|
23
56
|
};
|
|
24
57
|
/** @internal */
|
|
25
58
|
export declare const SamlLoginRequiredResponse$inboundSchema: z.ZodType<SamlLoginRequiredResponse, z.ZodTypeDef, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"samlloginrequiredresponse.d.ts","sourceRoot":"","sources":["../../../../src/models/components/samlloginrequiredresponse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"samlloginrequiredresponse.d.ts","sourceRoot":"","sources":["../../../../src/models/components/samlloginrequiredresponse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,uCAAuC,EAAE,CAAC,CAAC,OAAO,CAC7D,yBAAyB,EACzB,CAAC,CAAC,UAAU,EACZ,OAAO,CAcP,CAAC;AAEH,wBAAgB,iCAAiC,CAC/C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,yBAAyB,EAAE,kBAAkB,CAAC,CAMhE"}
|
|
@@ -12,10 +12,12 @@ export const SamlLoginRequiredResponse$inboundSchema = z.object({
|
|
|
12
12
|
error: types.string(),
|
|
13
13
|
sso_instructions: types.optional(types.string()),
|
|
14
14
|
sso_url: types.string(),
|
|
15
|
+
sso_state: types.optional(types.string()),
|
|
15
16
|
}).transform((v) => {
|
|
16
17
|
return remap$(v, {
|
|
17
18
|
"sso_instructions": "ssoInstructions",
|
|
18
19
|
"sso_url": "ssoUrl",
|
|
20
|
+
"sso_state": "ssoState",
|
|
19
21
|
});
|
|
20
22
|
});
|
|
21
23
|
export function samlLoginRequiredResponseFromJSON(jsonString) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"samlloginrequiredresponse.js","sourceRoot":"","sources":["../../../../src/models/components/samlloginrequiredresponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"samlloginrequiredresponse.js","sourceRoot":"","sources":["../../../../src/models/components/samlloginrequiredresponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;AAyDnD,gBAAgB;AAChB,MAAM,CAAC,MAAM,uCAAuC,GAIhD,CAAC,CAAC,MAAM,CAAC;IACX,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC;IACrC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;IACxB,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;IACrB,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IAChD,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE;IACvB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;CAC1C,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,kBAAkB,EAAE,iBAAiB;QACrC,SAAS,EAAE,QAAQ;QACnB,WAAW,EAAE,UAAU;KACxB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,iCAAiC,CAC/C,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,uCAAuC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACnE,uDAAuD,CACxD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as z from "zod/v3";
|
|
2
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Where to send the browser to finish a "Login with Green Security" flow.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
*
|
|
9
|
+
* Present on a `200` from `POST /users/authenticate` only when the request
|
|
10
|
+
* carried a valid, unexpired `sso_state`. Its absence means the login
|
|
11
|
+
* succeeded but the SAML flow did not resume — treat the login as an
|
|
12
|
+
* ordinary one rather than retrying.
|
|
13
|
+
*
|
|
14
|
+
* This object is additive. The login itself is unaffected by it: the
|
|
15
|
+
* caller's own permanent token is in `user_token` exactly as it would be on
|
|
16
|
+
* any other successful authentication, and it is not the token embedded in
|
|
17
|
+
* `continue_url`.
|
|
18
|
+
*/
|
|
19
|
+
export type SsoContinuation = {
|
|
20
|
+
/**
|
|
21
|
+
* An absolute, single-use URL on Green Security's domain. Navigate the
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* browser to it (a full page navigation, not `fetch`); it answers with a
|
|
25
|
+
* self-submitting form that POSTs the signed `SAMLResponse` and the
|
|
26
|
+
* original `RelayState` to the service provider's assertion consumer
|
|
27
|
+
* service URL.
|
|
28
|
+
*
|
|
29
|
+
* The `token` in this URL is a separate **one-time** token that is
|
|
30
|
+
* consumed the first time the URL is followed, so the URL is good for
|
|
31
|
+
* exactly one navigation. It is not the caller's permanent token, which
|
|
32
|
+
* is returned unchanged in `user_token`. Treat the URL as a secret:
|
|
33
|
+
* whoever follows it first receives that user's assertion.
|
|
34
|
+
*
|
|
35
|
+
* Never fetch this URL from your own back end: the response is meant for
|
|
36
|
+
* the user's browser, and posting the assertion from anywhere else
|
|
37
|
+
* breaks the flow.
|
|
38
|
+
*/
|
|
39
|
+
continueUrl: string;
|
|
40
|
+
};
|
|
41
|
+
/** @internal */
|
|
42
|
+
export declare const SsoContinuation$inboundSchema: z.ZodType<SsoContinuation, z.ZodTypeDef, unknown>;
|
|
43
|
+
export declare function ssoContinuationFromJSON(jsonString: string): SafeParseResult<SsoContinuation, SDKValidationError>;
|
|
44
|
+
//# sourceMappingURL=ssocontinuation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssocontinuation.d.ts","sourceRoot":"","sources":["../../../../src/models/components/ssocontinuation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,EAAE,CAAC,CAAC,OAAO,CACnD,eAAe,EACf,CAAC,CAAC,UAAU,EACZ,OAAO,CAOP,CAAC;AAEH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAMtD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v3";
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import * as types from "../../types/primitives.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const SsoContinuation$inboundSchema = z.object({
|
|
10
|
+
continue_url: types.string(),
|
|
11
|
+
}).transform((v) => {
|
|
12
|
+
return remap$(v, {
|
|
13
|
+
"continue_url": "continueUrl",
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
export function ssoContinuationFromJSON(jsonString) {
|
|
17
|
+
return safeParse(jsonString, (x) => SsoContinuation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SsoContinuation' from JSON`);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ssocontinuation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssocontinuation.js","sourceRoot":"","sources":["../../../../src/models/components/ssocontinuation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;AAyCnD,gBAAgB;AAChB,MAAM,CAAC,MAAM,6BAA6B,GAItC,CAAC,CAAC,MAAM,CAAC;IACX,YAAY,EAAE,KAAK,CAAC,MAAM,EAAE;CAC7B,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,cAAc,EAAE,aAAa;KAC9B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,uBAAuB,CACrC,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,6BAA6B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACzD,6CAA6C,CAC9C,CAAC;AACJ,CAAC"}
|
|
@@ -10,7 +10,7 @@ export type PostAuthenticateRequestBody = components.LoginEmailAndPassword | com
|
|
|
10
10
|
* The request has been accepted for processing, but the processing has not been completed. The request might be processed later.
|
|
11
11
|
*/
|
|
12
12
|
export type PostAuthenticateResponseBody = components.MfaRequiredResponse | components.SamlLoginRequiredResponse | components.PasswordRequiredResponse | components.PasswordNotSetResponse;
|
|
13
|
-
export type PostAuthenticateResponse = components.
|
|
13
|
+
export type PostAuthenticateResponse = components.AuthenticateSuccessResponse | components.MfaRequiredResponse | components.SamlLoginRequiredResponse | components.PasswordRequiredResponse | components.PasswordNotSetResponse;
|
|
14
14
|
/** @internal */
|
|
15
15
|
export type PostAuthenticateRequestBody$Outbound = components.LoginEmailAndPassword$Outbound | components.LoginRequirementsFromEmail$Outbound;
|
|
16
16
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postauthenticate.d.ts","sourceRoot":"","sources":["../../../../src/models/operations/postauthenticate.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,2BAA2B,GACnC,UAAU,CAAC,qBAAqB,GAChC,UAAU,CAAC,0BAA0B,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,4BAA4B,GACpC,UAAU,CAAC,mBAAmB,GAC9B,UAAU,CAAC,yBAAyB,GACpC,UAAU,CAAC,wBAAwB,GACnC,UAAU,CAAC,sBAAsB,CAAC;AAEtC,MAAM,MAAM,wBAAwB,GAChC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"postauthenticate.d.ts","sourceRoot":"","sources":["../../../../src/models/operations/postauthenticate.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,M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thenticateResponseBodyFromJSON(jsonString) {
|
|
|
25
25
|
}
|
|
26
26
|
/** @internal */
|
|
27
27
|
export const PostAuthenticateResponse$inboundSchema = smartUnion([
|
|
28
|
-
components.
|
|
28
|
+
components.AuthenticateSuccessResponse$inboundSchema,
|
|
29
29
|
z.union([
|
|
30
30
|
components.MfaRequiredResponse$inboundSchema,
|
|
31
31
|
components.SamlLoginRequiredResponse$inboundSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postauthenticate.js","sourceRoot":"","sources":["../../../../src/models/operations/postauthenticate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AA+BrD,gBAAgB;AAChB,MAAM,CAAC,MAAM,0CAA0C,GAInD,UAAU,CAAC;IACb,UAAU,CAAC,oCAAoC;IAC/C,UAAU,CAAC,yCAAyC;CACrD,CAAC,CAAC;AAEH,MAAM,UAAU,iCAAiC,CAC/C,2BAAwD;IAExD,OAAO,IAAI,CAAC,SAAS,CACnB,0CAA0C,CAAC,KAAK,CAC9C,2BAA2B,CAC5B,CACF,CAAC;AACJ,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,0CAA0C,GAInD,CAAC,CAAC,KAAK,CAAC;IACV,UAAU,CAAC,iCAAiC;IAC5C,UAAU,CAAC,uCAAuC;IAClD,UAAU,CAAC,sCAAsC;IACjD,UAAU,CAAC,oCAAoC;CAChD,CAAC,CAAC;AAEH,MAAM,UAAU,oCAAoC,CAClD,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,0CAA0C,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACtE,0DAA0D,CAC3D,CAAC;AACJ,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,sCAAsC,GAI/C,UAAU,CAAC;IACb,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"postauthenticate.js","sourceRoot":"","sources":["../../../../src/models/operations/postauthenticate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AA+BrD,gBAAgB;AAChB,MAAM,CAAC,MAAM,0CAA0C,GAInD,UAAU,CAAC;IACb,UAAU,CAAC,oCAAoC;IAC/C,UAAU,CAAC,yCAAyC;CACrD,CAAC,CAAC;AAEH,MAAM,UAAU,iCAAiC,CAC/C,2BAAwD;IAExD,OAAO,IAAI,CAAC,SAAS,CACnB,0CAA0C,CAAC,KAAK,CAC9C,2BAA2B,CAC5B,CACF,CAAC;AACJ,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,0CAA0C,GAInD,CAAC,CAAC,KAAK,CAAC;IACV,UAAU,CAAC,iCAAiC;IAC5C,UAAU,CAAC,uCAAuC;IAClD,UAAU,CAAC,sCAAsC;IACjD,UAAU,CAAC,oCAAoC;CAChD,CAAC,CAAC;AAEH,MAAM,UAAU,oCAAoC,CAClD,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,0CAA0C,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACtE,0DAA0D,CAC3D,CAAC;AACJ,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,sCAAsC,GAI/C,UAAU,CAAC;IACb,UAAU,CAAC,yCAAyC;IACpD,CAAC,CAAC,KAAK,CAAC;QACN,UAAU,CAAC,iCAAiC;QAC5C,UAAU,CAAC,uCAAuC;QAClD,UAAU,CAAC,sCAAsC;QACjD,UAAU,CAAC,oCAAoC;KAChD,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,UAAU,gCAAgC,CAC9C,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,sCAAsC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAClE,sDAAsD,CACvD,CAAC;AACJ,CAAC"}
|
|
@@ -49,6 +49,43 @@ export type UsersPostAuthenticateMutationError = errors.ApiErrorResponse | Green
|
|
|
49
49
|
* 3. Site redirects to your selected `return_url`
|
|
50
50
|
* 4. The `user_token` will be appended as a query string parameter to your `return_url` - you must parse this token and store it
|
|
51
51
|
* 5. Fetch the user object from `/users/me` using the token
|
|
52
|
+
*
|
|
53
|
+
* ## Finishing a "Login with Green Security" flow
|
|
54
|
+
*
|
|
55
|
+
* Green Security is also a SAML2 **identity provider**. When a third-party service provider sends a user to
|
|
56
|
+
* `/saml/idp/sso` to sign in with their Green Security account, the user lands on a Green Security login screen
|
|
57
|
+
* carrying an `sso_state` query string parameter. That parameter is a signed, five-minute record of which service
|
|
58
|
+
* provider is waiting, where its assertion consumer service lives, and what `RelayState` it sent.
|
|
59
|
+
*
|
|
60
|
+
* Authentication itself is unchanged - the user may still need a password, an MFA code, a magic link or a round trip
|
|
61
|
+
* to their own SAML IdP, and every `requires` value above applies as normal. The only difference is that you must
|
|
62
|
+
* echo `sso_state` back on **every** call in the sequence, unchanged, including the follow-up that carries the
|
|
63
|
+
* `mfa_code`.
|
|
64
|
+
*
|
|
65
|
+
* Each `202` response carries the verified blob back to you in its own top-level `sso_state` field. Send back the
|
|
66
|
+
* value from the response you just received rather than the one you started with. The two are normally the same
|
|
67
|
+
* string, but re-sending your original copy is how a blob the server has already rejected gets resent, and it forces
|
|
68
|
+
* you to hold login state you would otherwise not need.
|
|
69
|
+
*
|
|
70
|
+
* 1. Read `sso_state` from the query string of the login screen you were sent to
|
|
71
|
+
* 2. Run the login exactly as you would otherwise, adding `sso_state` to each request body and taking the value for
|
|
72
|
+
* the next request from the previous `202` response
|
|
73
|
+
* 3. On the `200` response, read `sso.continue_url`
|
|
74
|
+
* 4. Navigate the browser to `sso.continue_url` - a full page navigation, not a background fetch. It answers with a
|
|
75
|
+
* self-submitting form that delivers the signed `SAMLResponse` and the original `RelayState` to the service
|
|
76
|
+
* provider
|
|
77
|
+
* 5. The service provider validates the assertion and the user is signed in on their side
|
|
78
|
+
*
|
|
79
|
+
* On the `password_reset` leg the blob is **also** appended to `redirect_url` as a query parameter, alongside
|
|
80
|
+
* `return_url`. The browser follows that redirect and leaves the JSON body behind, so anything the remaining legs of
|
|
81
|
+
* the login still need has to ride the URL. Preserve the query string exactly as given.
|
|
82
|
+
*
|
|
83
|
+
* An invalid `sso_state` never fails a login. A forged, edited or expired blob is silently dropped and the request is
|
|
84
|
+
* then treated as an ordinary login, so valid credentials still return `200` - just with no `sso` object. Check for
|
|
85
|
+
* `sso` explicitly rather than reading `200` as proof the hand-off survived. When it is absent, do not retry with the
|
|
86
|
+
* same blob; the user has to start again from the service provider. See the
|
|
87
|
+
* [Login with Green Security](https://greensecurity.apidocumentation.com/guides/sso-login-with-green-security)
|
|
88
|
+
* guide for the service provider half of this flow.
|
|
52
89
|
*/
|
|
53
90
|
export declare function useUsersPostAuthenticateMutation(options?: MutationHookOptions<UsersPostAuthenticateMutationData, UsersPostAuthenticateMutationError, UsersPostAuthenticateMutationVariables>): UseMutationResult<UsersPostAuthenticateMutationData, UsersPostAuthenticateMutationError, UsersPostAuthenticateMutationVariables>;
|
|
54
91
|
export declare function mutationKeyUsersPostAuthenticate(): MutationKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usersPostAuthenticate.d.ts","sourceRoot":"","sources":["../../../src/react-query/usersPostAuthenticate.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EAEX,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,MAAM,sCAAsC,GAAG;IACnD,OAAO,EAAE,UAAU,CAAC,2BAA2B,CAAC;IAChD,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAC3C,UAAU,CAAC,wBAAwB,CAAC;AAEtC,MAAM,MAAM,kCAAkC,GAC1C,MAAM,CAAC,gBAAgB,GACvB,kBAAkB,GAClB,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB
|
|
1
|
+
{"version":3,"file":"usersPostAuthenticate.d.ts","sourceRoot":"","sources":["../../../src/react-query/usersPostAuthenticate.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EAEX,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,kBAA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,CAAC,iCAAiC,CAAC,CAAC;CACjD,CA0BA"}
|
|
@@ -41,6 +41,43 @@ import { useGreenSecurityContext } from "./_context.js";
|
|
|
41
41
|
* 3. Site redirects to your selected `return_url`
|
|
42
42
|
* 4. The `user_token` will be appended as a query string parameter to your `return_url` - you must parse this token and store it
|
|
43
43
|
* 5. Fetch the user object from `/users/me` using the token
|
|
44
|
+
*
|
|
45
|
+
* ## Finishing a "Login with Green Security" flow
|
|
46
|
+
*
|
|
47
|
+
* Green Security is also a SAML2 **identity provider**. When a third-party service provider sends a user to
|
|
48
|
+
* `/saml/idp/sso` to sign in with their Green Security account, the user lands on a Green Security login screen
|
|
49
|
+
* carrying an `sso_state` query string parameter. That parameter is a signed, five-minute record of which service
|
|
50
|
+
* provider is waiting, where its assertion consumer service lives, and what `RelayState` it sent.
|
|
51
|
+
*
|
|
52
|
+
* Authentication itself is unchanged - the user may still need a password, an MFA code, a magic link or a round trip
|
|
53
|
+
* to their own SAML IdP, and every `requires` value above applies as normal. The only difference is that you must
|
|
54
|
+
* echo `sso_state` back on **every** call in the sequence, unchanged, including the follow-up that carries the
|
|
55
|
+
* `mfa_code`.
|
|
56
|
+
*
|
|
57
|
+
* Each `202` response carries the verified blob back to you in its own top-level `sso_state` field. Send back the
|
|
58
|
+
* value from the response you just received rather than the one you started with. The two are normally the same
|
|
59
|
+
* string, but re-sending your original copy is how a blob the server has already rejected gets resent, and it forces
|
|
60
|
+
* you to hold login state you would otherwise not need.
|
|
61
|
+
*
|
|
62
|
+
* 1. Read `sso_state` from the query string of the login screen you were sent to
|
|
63
|
+
* 2. Run the login exactly as you would otherwise, adding `sso_state` to each request body and taking the value for
|
|
64
|
+
* the next request from the previous `202` response
|
|
65
|
+
* 3. On the `200` response, read `sso.continue_url`
|
|
66
|
+
* 4. Navigate the browser to `sso.continue_url` - a full page navigation, not a background fetch. It answers with a
|
|
67
|
+
* self-submitting form that delivers the signed `SAMLResponse` and the original `RelayState` to the service
|
|
68
|
+
* provider
|
|
69
|
+
* 5. The service provider validates the assertion and the user is signed in on their side
|
|
70
|
+
*
|
|
71
|
+
* On the `password_reset` leg the blob is **also** appended to `redirect_url` as a query parameter, alongside
|
|
72
|
+
* `return_url`. The browser follows that redirect and leaves the JSON body behind, so anything the remaining legs of
|
|
73
|
+
* the login still need has to ride the URL. Preserve the query string exactly as given.
|
|
74
|
+
*
|
|
75
|
+
* An invalid `sso_state` never fails a login. A forged, edited or expired blob is silently dropped and the request is
|
|
76
|
+
* then treated as an ordinary login, so valid credentials still return `200` - just with no `sso` object. Check for
|
|
77
|
+
* `sso` explicitly rather than reading `200` as proof the hand-off survived. When it is absent, do not retry with the
|
|
78
|
+
* same blob; the user has to start again from the service provider. See the
|
|
79
|
+
* [Login with Green Security](https://greensecurity.apidocumentation.com/guides/sso-login-with-green-security)
|
|
80
|
+
* guide for the service provider half of this flow.
|
|
44
81
|
*/
|
|
45
82
|
export function useUsersPostAuthenticateMutation(options) {
|
|
46
83
|
const client = useGreenSecurityContext();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usersPostAuthenticate.js","sourceRoot":"","sources":["../../../src/react-query/usersPostAuthenticate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,WAAW,GAEZ,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AActD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAsBxD
|
|
1
|
+
{"version":3,"file":"usersPostAuthenticate.js","sourceRoot":"","sources":["../../../src/react-query/usersPostAuthenticate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,WAAW,GAEZ,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AActD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAsBxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,MAAM,UAAU,gCAAgC,CAC9C,OAIC;IAMD,MAAM,MAAM,GAAG,uBAAuB,EAAE,CAAC;IACzC,OAAO,WAAW,CAAC;QACjB,GAAG,kCAAkC,CAAC,MAAM,EAAE,OAAO,CAAC;QACtD,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,gCAAgC;IAC9C,OAAO,CAAC,+BAA+B,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,kCAAkC,CAChD,OAA0B,EAC1B,WAA4B;IAO5B,OAAO;QACL,WAAW,EAAE,gCAAgC,EAAE;QAC/C,UAAU,EAAE,SAAS,+BAA+B,CAAC,EACnD,OAAO,EACP,OAAO,GACR;YACC,MAAM,aAAa,GAAG;gBACpB,GAAG,WAAW;gBACd,GAAG,OAAO;gBACV,YAAY,EAAE;oBACZ,GAAG,WAAW,EAAE,YAAY;oBAC5B,GAAG,OAAO,EAAE,YAAY;oBACxB,MAAM,EAAE,cAAc,CACpB,WAAW,EAAE,YAAY,EAAE,MAAM,EACjC,OAAO,EAAE,YAAY,EAAE,MAAM,CAC9B;iBACF;aACF,CAAC;YACF,OAAO,WAAW,CAAC,qBAAqB,CACtC,OAAO,EACP,OAAO,EACP,aAAa,CACd,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/esm/sdk/users.d.ts
CHANGED
|
@@ -100,6 +100,43 @@ export declare class Users extends ClientSDK {
|
|
|
100
100
|
* 3. Site redirects to your selected `return_url`
|
|
101
101
|
* 4. The `user_token` will be appended as a query string parameter to your `return_url` - you must parse this token and store it
|
|
102
102
|
* 5. Fetch the user object from `/users/me` using the token
|
|
103
|
+
*
|
|
104
|
+
* ## Finishing a "Login with Green Security" flow
|
|
105
|
+
*
|
|
106
|
+
* Green Security is also a SAML2 **identity provider**. When a third-party service provider sends a user to
|
|
107
|
+
* `/saml/idp/sso` to sign in with their Green Security account, the user lands on a Green Security login screen
|
|
108
|
+
* carrying an `sso_state` query string parameter. That parameter is a signed, five-minute record of which service
|
|
109
|
+
* provider is waiting, where its assertion consumer service lives, and what `RelayState` it sent.
|
|
110
|
+
*
|
|
111
|
+
* Authentication itself is unchanged - the user may still need a password, an MFA code, a magic link or a round trip
|
|
112
|
+
* to their own SAML IdP, and every `requires` value above applies as normal. The only difference is that you must
|
|
113
|
+
* echo `sso_state` back on **every** call in the sequence, unchanged, including the follow-up that carries the
|
|
114
|
+
* `mfa_code`.
|
|
115
|
+
*
|
|
116
|
+
* Each `202` response carries the verified blob back to you in its own top-level `sso_state` field. Send back the
|
|
117
|
+
* value from the response you just received rather than the one you started with. The two are normally the same
|
|
118
|
+
* string, but re-sending your original copy is how a blob the server has already rejected gets resent, and it forces
|
|
119
|
+
* you to hold login state you would otherwise not need.
|
|
120
|
+
*
|
|
121
|
+
* 1. Read `sso_state` from the query string of the login screen you were sent to
|
|
122
|
+
* 2. Run the login exactly as you would otherwise, adding `sso_state` to each request body and taking the value for
|
|
123
|
+
* the next request from the previous `202` response
|
|
124
|
+
* 3. On the `200` response, read `sso.continue_url`
|
|
125
|
+
* 4. Navigate the browser to `sso.continue_url` - a full page navigation, not a background fetch. It answers with a
|
|
126
|
+
* self-submitting form that delivers the signed `SAMLResponse` and the original `RelayState` to the service
|
|
127
|
+
* provider
|
|
128
|
+
* 5. The service provider validates the assertion and the user is signed in on their side
|
|
129
|
+
*
|
|
130
|
+
* On the `password_reset` leg the blob is **also** appended to `redirect_url` as a query parameter, alongside
|
|
131
|
+
* `return_url`. The browser follows that redirect and leaves the JSON body behind, so anything the remaining legs of
|
|
132
|
+
* the login still need has to ride the URL. Preserve the query string exactly as given.
|
|
133
|
+
*
|
|
134
|
+
* An invalid `sso_state` never fails a login. A forged, edited or expired blob is silently dropped and the request is
|
|
135
|
+
* then treated as an ordinary login, so valid credentials still return `200` - just with no `sso` object. Check for
|
|
136
|
+
* `sso` explicitly rather than reading `200` as proof the hand-off survived. When it is absent, do not retry with the
|
|
137
|
+
* same blob; the user has to start again from the service provider. See the
|
|
138
|
+
* [Login with Green Security](https://greensecurity.apidocumentation.com/guides/sso-login-with-green-security)
|
|
139
|
+
* guide for the service provider half of this flow.
|
|
103
140
|
*/
|
|
104
141
|
postAuthenticate(request: operations.PostAuthenticateRequestBody, options?: RequestOptions): Promise<operations.PostAuthenticateResponse>;
|
|
105
142
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../src/sdk/users.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,KAAM,SAAQ,SAAS;IAClC;;;;;;;;;;;;;;;;;OAiBG;IACG,cAAc,CAClB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;IAQ3B;;;;;;;;;;;;;OAaG;IACG,WAAW,CACf,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;IAQ3B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,UAAU,CACd,OAAO,EAAE,UAAU,CAAC,iBAAiB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB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B,OAAO,CAAC,UAAU,CAAC,8BAA8B,CAAC;IAQrD;;;;;OAKG;IACG,aAAa,CACjB,OAAO,EAAE,UAAU,CAAC,wBAAwB,EAC5C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,yBAAyB,CAAC;IAQhD;;;;;OAKG;IACG,SAAS,CACb,OAAO,EAAE,UAAU,CAAC,oBAAoB,EACxC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC;IAQ3C;;;;;OAKG;IACG,oBAAoB,CACxB,OAAO,EAAE,UAAU,CAAC,+BAA+B,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,0CAA0C,CAAC;IAQjE;;;;;;OAMG;IACG,QAAQ,CACZ,OAAO,EAAE,UAAU,CAAC,mBAAmB,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC;IAQzC;;;;;OAKG;IACG,cAAc,CAClB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,8BAA8B,CAAC;IAQrD;;;;;OAKG;IACG,wBAAwB,CAC5B,OAAO,EAAE,UAAU,CAAC,+BAA+B,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,kDAAkD,CAAC;CAO1E"}
|
package/dist/esm/sdk/users.js
CHANGED
|
@@ -120,6 +120,43 @@ export class Users extends ClientSDK {
|
|
|
120
120
|
* 3. Site redirects to your selected `return_url`
|
|
121
121
|
* 4. The `user_token` will be appended as a query string parameter to your `return_url` - you must parse this token and store it
|
|
122
122
|
* 5. Fetch the user object from `/users/me` using the token
|
|
123
|
+
*
|
|
124
|
+
* ## Finishing a "Login with Green Security" flow
|
|
125
|
+
*
|
|
126
|
+
* Green Security is also a SAML2 **identity provider**. When a third-party service provider sends a user to
|
|
127
|
+
* `/saml/idp/sso` to sign in with their Green Security account, the user lands on a Green Security login screen
|
|
128
|
+
* carrying an `sso_state` query string parameter. That parameter is a signed, five-minute record of which service
|
|
129
|
+
* provider is waiting, where its assertion consumer service lives, and what `RelayState` it sent.
|
|
130
|
+
*
|
|
131
|
+
* Authentication itself is unchanged - the user may still need a password, an MFA code, a magic link or a round trip
|
|
132
|
+
* to their own SAML IdP, and every `requires` value above applies as normal. The only difference is that you must
|
|
133
|
+
* echo `sso_state` back on **every** call in the sequence, unchanged, including the follow-up that carries the
|
|
134
|
+
* `mfa_code`.
|
|
135
|
+
*
|
|
136
|
+
* Each `202` response carries the verified blob back to you in its own top-level `sso_state` field. Send back the
|
|
137
|
+
* value from the response you just received rather than the one you started with. The two are normally the same
|
|
138
|
+
* string, but re-sending your original copy is how a blob the server has already rejected gets resent, and it forces
|
|
139
|
+
* you to hold login state you would otherwise not need.
|
|
140
|
+
*
|
|
141
|
+
* 1. Read `sso_state` from the query string of the login screen you were sent to
|
|
142
|
+
* 2. Run the login exactly as you would otherwise, adding `sso_state` to each request body and taking the value for
|
|
143
|
+
* the next request from the previous `202` response
|
|
144
|
+
* 3. On the `200` response, read `sso.continue_url`
|
|
145
|
+
* 4. Navigate the browser to `sso.continue_url` - a full page navigation, not a background fetch. It answers with a
|
|
146
|
+
* self-submitting form that delivers the signed `SAMLResponse` and the original `RelayState` to the service
|
|
147
|
+
* provider
|
|
148
|
+
* 5. The service provider validates the assertion and the user is signed in on their side
|
|
149
|
+
*
|
|
150
|
+
* On the `password_reset` leg the blob is **also** appended to `redirect_url` as a query parameter, alongside
|
|
151
|
+
* `return_url`. The browser follows that redirect and leaves the JSON body behind, so anything the remaining legs of
|
|
152
|
+
* the login still need has to ride the URL. Preserve the query string exactly as given.
|
|
153
|
+
*
|
|
154
|
+
* An invalid `sso_state` never fails a login. A forged, edited or expired blob is silently dropped and the request is
|
|
155
|
+
* then treated as an ordinary login, so valid credentials still return `200` - just with no `sso` object. Check for
|
|
156
|
+
* `sso` explicitly rather than reading `200` as proof the hand-off survived. When it is absent, do not retry with the
|
|
157
|
+
* same blob; the user has to start again from the service provider. See the
|
|
158
|
+
* [Login with Green Security](https://greensecurity.apidocumentation.com/guides/sso-login-with-green-security)
|
|
159
|
+
* guide for the service provider half of this flow.
|
|
123
160
|
*/
|
|
124
161
|
async postAuthenticate(request, options) {
|
|
125
162
|
return unwrapAsync(usersPostAuthenticate(this, request, options));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../../src/sdk/users.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,KAAM,SAAQ,SAAS;IAClC;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CAAC,cAAc,CAClB,OAA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,EAC5C,OAAwB;QAExB,OAAO,WAAW,CAAC,kBAAkB,CACnC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CACb,OAAwC,EACxC,OAAwB;QAExB,OAAO,WAAW,CAAC,cAAc,CAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAAmD,EACnD,OAAwB;QAExB,OAAO,WAAW,CAAC,yBAAyB,CAC1C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,QAAQ,CACZ,OAAuC,EACvC,OAAwB;QAExB,OAAO,WAAW,CAAC,aAAa,CAC9B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,cAAc,CAClB,OAAyC,EACzC,OAAwB;QAExB,OAAO,WAAW,CAAC,mBAAmB,CACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,wBAAwB,CAC5B,OAAmD,EACnD,OAAwB;QAExB,OAAO,WAAW,CAAC,6BAA6B,CAC9C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@ test("Webhooks List All Webhook Endpoints", async () => {
|
|
|
20
20
|
const testWebhookListForVendorUserResult = await greenSecurity.webhooks
|
|
21
21
|
.listAllWebhookEndpoints({
|
|
22
22
|
itemsPerPage: 25,
|
|
23
|
-
desc:
|
|
23
|
+
desc: 0,
|
|
24
24
|
sort: "",
|
|
25
25
|
});
|
|
26
26
|
expect(testWebhookListForVendorUserResult).toBeDefined();
|
|
@@ -39,14 +39,7 @@ test("Zones List Or Search Security Zones", async () => {
|
|
|
39
39
|
facility: {},
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
facility: {
|
|
43
|
-
contacts: null,
|
|
44
|
-
vendorGuestPolicy: {
|
|
45
|
-
enabled: true,
|
|
46
|
-
vendorGuestLimitAndOr: "and",
|
|
47
|
-
vendorGuestRequireEmail: false,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
42
|
+
facility: {},
|
|
50
43
|
},
|
|
51
44
|
],
|
|
52
45
|
});
|
|
@@ -65,7 +58,7 @@ test("Zones Security Zone Checkin", async () => {
|
|
|
65
58
|
|
|
66
59
|
const result = await greenSecurity.zones.securityZoneCheckin({
|
|
67
60
|
qrCode: "<value>",
|
|
68
|
-
zoneId:
|
|
61
|
+
zoneId: 997849,
|
|
69
62
|
});
|
|
70
63
|
expect(result).toBeDefined();
|
|
71
64
|
expect(result).toEqual({});
|
|
@@ -60,6 +60,43 @@ import { Result } from "../types/fp.js";
|
|
|
60
60
|
* 3. Site redirects to your selected `return_url`
|
|
61
61
|
* 4. The `user_token` will be appended as a query string parameter to your `return_url` - you must parse this token and store it
|
|
62
62
|
* 5. Fetch the user object from `/users/me` using the token
|
|
63
|
+
*
|
|
64
|
+
* ## Finishing a "Login with Green Security" flow
|
|
65
|
+
*
|
|
66
|
+
* Green Security is also a SAML2 **identity provider**. When a third-party service provider sends a user to
|
|
67
|
+
* `/saml/idp/sso` to sign in with their Green Security account, the user lands on a Green Security login screen
|
|
68
|
+
* carrying an `sso_state` query string parameter. That parameter is a signed, five-minute record of which service
|
|
69
|
+
* provider is waiting, where its assertion consumer service lives, and what `RelayState` it sent.
|
|
70
|
+
*
|
|
71
|
+
* Authentication itself is unchanged - the user may still need a password, an MFA code, a magic link or a round trip
|
|
72
|
+
* to their own SAML IdP, and every `requires` value above applies as normal. The only difference is that you must
|
|
73
|
+
* echo `sso_state` back on **every** call in the sequence, unchanged, including the follow-up that carries the
|
|
74
|
+
* `mfa_code`.
|
|
75
|
+
*
|
|
76
|
+
* Each `202` response carries the verified blob back to you in its own top-level `sso_state` field. Send back the
|
|
77
|
+
* value from the response you just received rather than the one you started with. The two are normally the same
|
|
78
|
+
* string, but re-sending your original copy is how a blob the server has already rejected gets resent, and it forces
|
|
79
|
+
* you to hold login state you would otherwise not need.
|
|
80
|
+
*
|
|
81
|
+
* 1. Read `sso_state` from the query string of the login screen you were sent to
|
|
82
|
+
* 2. Run the login exactly as you would otherwise, adding `sso_state` to each request body and taking the value for
|
|
83
|
+
* the next request from the previous `202` response
|
|
84
|
+
* 3. On the `200` response, read `sso.continue_url`
|
|
85
|
+
* 4. Navigate the browser to `sso.continue_url` - a full page navigation, not a background fetch. It answers with a
|
|
86
|
+
* self-submitting form that delivers the signed `SAMLResponse` and the original `RelayState` to the service
|
|
87
|
+
* provider
|
|
88
|
+
* 5. The service provider validates the assertion and the user is signed in on their side
|
|
89
|
+
*
|
|
90
|
+
* On the `password_reset` leg the blob is **also** appended to `redirect_url` as a query parameter, alongside
|
|
91
|
+
* `return_url`. The browser follows that redirect and leaves the JSON body behind, so anything the remaining legs of
|
|
92
|
+
* the login still need has to ride the URL. Preserve the query string exactly as given.
|
|
93
|
+
*
|
|
94
|
+
* An invalid `sso_state` never fails a login. A forged, edited or expired blob is silently dropped and the request is
|
|
95
|
+
* then treated as an ordinary login, so valid credentials still return `200` - just with no `sso` object. Check for
|
|
96
|
+
* `sso` explicitly rather than reading `200` as proof the hand-off survived. When it is absent, do not retry with the
|
|
97
|
+
* same blob; the user has to start again from the service provider. See the
|
|
98
|
+
* [Login with Green Security](https://greensecurity.apidocumentation.com/guides/sso-login-with-green-security)
|
|
99
|
+
* guide for the service provider half of this flow.
|
|
63
100
|
*/
|
|
64
101
|
export function usersPostAuthenticate(
|
|
65
102
|
client: GreenSecurityCore,
|
package/src/lib/config.ts
CHANGED
|
@@ -80,8 +80,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
80
80
|
export const SDK_METADATA = {
|
|
81
81
|
language: "typescript",
|
|
82
82
|
openapiDocVersion: "0.45.0",
|
|
83
|
-
sdkVersion: "0.45.0-beta.
|
|
83
|
+
sdkVersion: "0.45.0-beta.17",
|
|
84
84
|
genVersion: "2.935.1",
|
|
85
85
|
userAgent:
|
|
86
|
-
"speakeasy-sdk/typescript 0.45.0-beta.
|
|
86
|
+
"speakeasy-sdk/typescript 0.45.0-beta.17 2.935.1 0.45.0 @greensecurity/javascript-sdk",
|
|
87
87
|
} as const;
|