@greensecurity/javascript-sdk 0.45.0-beta.16 → 0.45.0-beta.18

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.
Files changed (137) hide show
  1. package/dist/commonjs/__tests__/vendors.test.js +1 -1
  2. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  3. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/zones.test.js +2 -9
  5. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  6. package/dist/commonjs/funcs/usersPostAuthenticate.d.ts +37 -0
  7. package/dist/commonjs/funcs/usersPostAuthenticate.d.ts.map +1 -1
  8. package/dist/commonjs/funcs/usersPostAuthenticate.js +37 -0
  9. package/dist/commonjs/funcs/usersPostAuthenticate.js.map +1 -1
  10. package/dist/commonjs/lib/config.d.ts +2 -2
  11. package/dist/commonjs/lib/config.js +2 -2
  12. package/dist/commonjs/models/components/authenticatesuccessresponse.d.ts +91 -0
  13. package/dist/commonjs/models/components/authenticatesuccessresponse.d.ts.map +1 -0
  14. package/dist/commonjs/models/components/authenticatesuccessresponse.js +100 -0
  15. package/dist/commonjs/models/components/authenticatesuccessresponse.js.map +1 -0
  16. package/dist/commonjs/models/components/index.d.ts +2 -0
  17. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  18. package/dist/commonjs/models/components/index.js +2 -0
  19. package/dist/commonjs/models/components/index.js.map +1 -1
  20. package/dist/commonjs/models/components/loginemailandpassword.d.ts +34 -0
  21. package/dist/commonjs/models/components/loginemailandpassword.d.ts.map +1 -1
  22. package/dist/commonjs/models/components/loginemailandpassword.js +2 -0
  23. package/dist/commonjs/models/components/loginemailandpassword.js.map +1 -1
  24. package/dist/commonjs/models/components/loginrequirementsfromemail.d.ts +34 -0
  25. package/dist/commonjs/models/components/loginrequirementsfromemail.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/loginrequirementsfromemail.js +2 -0
  27. package/dist/commonjs/models/components/loginrequirementsfromemail.js.map +1 -1
  28. package/dist/commonjs/models/components/mfarequiredresponse.d.ts +33 -0
  29. package/dist/commonjs/models/components/mfarequiredresponse.d.ts.map +1 -1
  30. package/dist/commonjs/models/components/mfarequiredresponse.js +2 -0
  31. package/dist/commonjs/models/components/mfarequiredresponse.js.map +1 -1
  32. package/dist/commonjs/models/components/passwordnotsetresponse.d.ts +34 -1
  33. package/dist/commonjs/models/components/passwordnotsetresponse.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/passwordnotsetresponse.js +2 -0
  35. package/dist/commonjs/models/components/passwordnotsetresponse.js.map +1 -1
  36. package/dist/commonjs/models/components/passwordrequiredresponse.d.ts +33 -0
  37. package/dist/commonjs/models/components/passwordrequiredresponse.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/passwordrequiredresponse.js +6 -0
  39. package/dist/commonjs/models/components/passwordrequiredresponse.js.map +1 -1
  40. package/dist/commonjs/models/components/samlloginrequiredresponse.d.ts +33 -0
  41. package/dist/commonjs/models/components/samlloginrequiredresponse.d.ts.map +1 -1
  42. package/dist/commonjs/models/components/samlloginrequiredresponse.js +2 -0
  43. package/dist/commonjs/models/components/samlloginrequiredresponse.js.map +1 -1
  44. package/dist/commonjs/models/components/ssocontinuation.d.ts +44 -0
  45. package/dist/commonjs/models/components/ssocontinuation.d.ts.map +1 -0
  46. package/dist/commonjs/models/components/ssocontinuation.js +56 -0
  47. package/dist/commonjs/models/components/ssocontinuation.js.map +1 -0
  48. package/dist/commonjs/models/operations/postauthenticate.d.ts +1 -1
  49. package/dist/commonjs/models/operations/postauthenticate.d.ts.map +1 -1
  50. package/dist/commonjs/models/operations/postauthenticate.js +1 -1
  51. package/dist/commonjs/models/operations/postauthenticate.js.map +1 -1
  52. package/dist/commonjs/react-query/usersPostAuthenticate.d.ts +37 -0
  53. package/dist/commonjs/react-query/usersPostAuthenticate.d.ts.map +1 -1
  54. package/dist/commonjs/react-query/usersPostAuthenticate.js +37 -0
  55. package/dist/commonjs/react-query/usersPostAuthenticate.js.map +1 -1
  56. package/dist/commonjs/sdk/users.d.ts +37 -0
  57. package/dist/commonjs/sdk/users.d.ts.map +1 -1
  58. package/dist/commonjs/sdk/users.js +37 -0
  59. package/dist/commonjs/sdk/users.js.map +1 -1
  60. package/dist/esm/__tests__/vendors.test.js +1 -1
  61. package/dist/esm/__tests__/webhooks.test.js +1 -1
  62. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  63. package/dist/esm/__tests__/zones.test.js +2 -9
  64. package/dist/esm/__tests__/zones.test.js.map +1 -1
  65. package/dist/esm/funcs/usersPostAuthenticate.d.ts +37 -0
  66. package/dist/esm/funcs/usersPostAuthenticate.d.ts.map +1 -1
  67. package/dist/esm/funcs/usersPostAuthenticate.js +37 -0
  68. package/dist/esm/funcs/usersPostAuthenticate.js.map +1 -1
  69. package/dist/esm/lib/config.d.ts +2 -2
  70. package/dist/esm/lib/config.js +2 -2
  71. package/dist/esm/models/components/authenticatesuccessresponse.d.ts +91 -0
  72. package/dist/esm/models/components/authenticatesuccessresponse.d.ts.map +1 -0
  73. package/dist/esm/models/components/authenticatesuccessresponse.js +61 -0
  74. package/dist/esm/models/components/authenticatesuccessresponse.js.map +1 -0
  75. package/dist/esm/models/components/index.d.ts +2 -0
  76. package/dist/esm/models/components/index.d.ts.map +1 -1
  77. package/dist/esm/models/components/index.js +2 -0
  78. package/dist/esm/models/components/index.js.map +1 -1
  79. package/dist/esm/models/components/loginemailandpassword.d.ts +34 -0
  80. package/dist/esm/models/components/loginemailandpassword.d.ts.map +1 -1
  81. package/dist/esm/models/components/loginemailandpassword.js +2 -0
  82. package/dist/esm/models/components/loginemailandpassword.js.map +1 -1
  83. package/dist/esm/models/components/loginrequirementsfromemail.d.ts +34 -0
  84. package/dist/esm/models/components/loginrequirementsfromemail.d.ts.map +1 -1
  85. package/dist/esm/models/components/loginrequirementsfromemail.js +2 -0
  86. package/dist/esm/models/components/loginrequirementsfromemail.js.map +1 -1
  87. package/dist/esm/models/components/mfarequiredresponse.d.ts +33 -0
  88. package/dist/esm/models/components/mfarequiredresponse.d.ts.map +1 -1
  89. package/dist/esm/models/components/mfarequiredresponse.js +2 -0
  90. package/dist/esm/models/components/mfarequiredresponse.js.map +1 -1
  91. package/dist/esm/models/components/passwordnotsetresponse.d.ts +34 -1
  92. package/dist/esm/models/components/passwordnotsetresponse.d.ts.map +1 -1
  93. package/dist/esm/models/components/passwordnotsetresponse.js +2 -0
  94. package/dist/esm/models/components/passwordnotsetresponse.js.map +1 -1
  95. package/dist/esm/models/components/passwordrequiredresponse.d.ts +33 -0
  96. package/dist/esm/models/components/passwordrequiredresponse.d.ts.map +1 -1
  97. package/dist/esm/models/components/passwordrequiredresponse.js +6 -0
  98. package/dist/esm/models/components/passwordrequiredresponse.js.map +1 -1
  99. package/dist/esm/models/components/samlloginrequiredresponse.d.ts +33 -0
  100. package/dist/esm/models/components/samlloginrequiredresponse.d.ts.map +1 -1
  101. package/dist/esm/models/components/samlloginrequiredresponse.js +2 -0
  102. package/dist/esm/models/components/samlloginrequiredresponse.js.map +1 -1
  103. package/dist/esm/models/components/ssocontinuation.d.ts +44 -0
  104. package/dist/esm/models/components/ssocontinuation.d.ts.map +1 -0
  105. package/dist/esm/models/components/ssocontinuation.js +19 -0
  106. package/dist/esm/models/components/ssocontinuation.js.map +1 -0
  107. package/dist/esm/models/operations/postauthenticate.d.ts +1 -1
  108. package/dist/esm/models/operations/postauthenticate.d.ts.map +1 -1
  109. package/dist/esm/models/operations/postauthenticate.js +1 -1
  110. package/dist/esm/models/operations/postauthenticate.js.map +1 -1
  111. package/dist/esm/react-query/usersPostAuthenticate.d.ts +37 -0
  112. package/dist/esm/react-query/usersPostAuthenticate.d.ts.map +1 -1
  113. package/dist/esm/react-query/usersPostAuthenticate.js +37 -0
  114. package/dist/esm/react-query/usersPostAuthenticate.js.map +1 -1
  115. package/dist/esm/sdk/users.d.ts +37 -0
  116. package/dist/esm/sdk/users.d.ts.map +1 -1
  117. package/dist/esm/sdk/users.js +37 -0
  118. package/dist/esm/sdk/users.js.map +1 -1
  119. package/jsr.json +1 -1
  120. package/package.json +1 -1
  121. package/src/__tests__/vendors.test.ts +1 -1
  122. package/src/__tests__/webhooks.test.ts +1 -1
  123. package/src/__tests__/zones.test.ts +2 -9
  124. package/src/funcs/usersPostAuthenticate.ts +37 -0
  125. package/src/lib/config.ts +2 -2
  126. package/src/models/components/authenticatesuccessresponse.ts +189 -0
  127. package/src/models/components/index.ts +2 -0
  128. package/src/models/components/loginemailandpassword.ts +36 -0
  129. package/src/models/components/loginrequirementsfromemail.ts +36 -0
  130. package/src/models/components/mfarequiredresponse.ts +35 -0
  131. package/src/models/components/passwordnotsetresponse.ts +36 -1
  132. package/src/models/components/passwordrequiredresponse.ts +39 -0
  133. package/src/models/components/samlloginrequiredresponse.ts +35 -0
  134. package/src/models/components/ssocontinuation.ts +71 -0
  135. package/src/models/operations/postauthenticate.ts +2 -2
  136. package/src/react-query/usersPostAuthenticate.ts +37 -0
  137. package/src/sdk/users.ts +37 -0
@@ -11,11 +11,45 @@ export type LoginRequirementsFromEmail = {
11
11
  * A proper URI where the user should be sent after completing a SAML login. This is encoded into the response you will get if the user requires a SAML login.
12
12
  */
13
13
  returnUrl: string;
14
+ /**
15
+ * Opaque, signed state that Green Security issues when a third-party service
16
+ *
17
+ * @remarks
18
+ * provider starts a "Login with Green Security" SAML flow at
19
+ * `/saml/idp/sso`. The login screen receives it as the `sso_state` query
20
+ * string parameter and must pass it back, byte for byte, on every call to
21
+ * this endpoint for the remainder of the login journey — including the
22
+ * second call that carries an `mfa_code`.
23
+ *
24
+ * The blob is signed, not encrypted, and it expires five minutes after the
25
+ * service provider's request arrives. Do not parse it, shorten it, decode
26
+ * it, or re-encode it.
27
+ *
28
+ * **An invalid blob does not fail the login.** This is the opposite of what
29
+ * most integrators assume, so it is worth stating plainly: a forged, edited
30
+ * or expired `sso_state` is silently discarded, and the request then
31
+ * proceeds as an ordinary login. Valid credentials still authenticate and
32
+ * still return `200` — just with no `sso` object, leaving the user signed in
33
+ * to Green Security with no way back to the service provider that sent them.
34
+ * Never treat a `200` as proof that the SSO hand-off survived; check for
35
+ * `sso` explicitly.
36
+ *
37
+ * Every `202` response echoes the *verified* blob back in its own
38
+ * `sso_state` field. Always send back the value from the response you just
39
+ * received rather than the one you started with, so that a blob the server
40
+ * has already rejected is never resent, and so a client does not have to
41
+ * hold state of its own across the login journey.
42
+ *
43
+ * Omit this field entirely for an ordinary login that did not originate
44
+ * from a service provider.
45
+ */
46
+ ssoState?: string | undefined;
14
47
  };
15
48
  /** @internal */
16
49
  export type LoginRequirementsFromEmail$Outbound = {
17
50
  email: string;
18
51
  return_url: string;
52
+ sso_state?: string | undefined;
19
53
  };
20
54
  /** @internal */
21
55
  export declare const LoginRequirementsFromEmail$outboundSchema: z.ZodType<LoginRequirementsFromEmail$Outbound, z.ZodTypeDef, LoginRequirementsFromEmail>;
@@ -1 +1 @@
1
- {"version":3,"file":"loginrequirementsfromemail.d.ts","sourceRoot":"","sources":["../../../../src/models/components/loginrequirementsfromemail.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,mCAAmC,GAAG;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,yCAAyC,EAAE,CAAC,CAAC,OAAO,CAC/D,mCAAmC,EACnC,CAAC,CAAC,UAAU,EACZ,0BAA0B,CAQ1B,CAAC;AAEH,wBAAgB,gCAAgC,CAC9C,0BAA0B,EAAE,0BAA0B,GACrD,MAAM,CAIR"}
1
+ {"version":3,"file":"loginrequirementsfromemail.d.ts","sourceRoot":"","sources":["../../../../src/models/components/loginrequirementsfromemail.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,mCAAmC,GAAG;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,yCAAyC,EAAE,CAAC,CAAC,OAAO,CAC/D,mCAAmC,EACnC,CAAC,CAAC,UAAU,EACZ,0BAA0B,CAU1B,CAAC;AAEH,wBAAgB,gCAAgC,CAC9C,0BAA0B,EAAE,0BAA0B,GACrD,MAAM,CAIR"}
@@ -7,9 +7,11 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  export const LoginRequirementsFromEmail$outboundSchema = z.object({
8
8
  email: z.string(),
9
9
  returnUrl: z.string(),
10
+ ssoState: z.string().optional(),
10
11
  }).transform((v) => {
11
12
  return remap$(v, {
12
13
  returnUrl: "return_url",
14
+ ssoState: "sso_state",
13
15
  });
14
16
  });
15
17
  export function loginRequirementsFromEmailToJSON(loginRequirementsFromEmail) {
@@ -1 +1 @@
1
- {"version":3,"file":"loginrequirementsfromemail.js","sourceRoot":"","sources":["../../../../src/models/components/loginrequirementsfromemail.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAsB1D,gBAAgB;AAChB,MAAM,CAAC,MAAM,yCAAyC,GAIlD,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,SAAS,EAAE,YAAY;KACxB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,gCAAgC,CAC9C,0BAAsD;IAEtD,OAAO,IAAI,CAAC,SAAS,CACnB,yCAAyC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAC5E,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"loginrequirementsfromemail.js","sourceRoot":"","sources":["../../../../src/models/components/loginrequirementsfromemail.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAwD1D,gBAAgB;AAChB,MAAM,CAAC,MAAM,yCAAyC,GAIlD,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,SAAS,EAAE,YAAY;QACvB,QAAQ,EAAE,WAAW;KACtB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,gCAAgC,CAC9C,0BAAsD;IAEtD,OAAO,IAAI,CAAC,SAAS,CACnB,yCAAyC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAC5E,CAAC;AACJ,CAAC"}
@@ -26,6 +26,39 @@ export type MfaRequiredResponse = {
26
26
  */
27
27
  mobilePhone?: string | undefined;
28
28
  mfaMethod?: MfaMethod | undefined;
29
+ /**
30
+ * Opaque, signed state that Green Security issues when a third-party service
31
+ *
32
+ * @remarks
33
+ * provider starts a "Login with Green Security" SAML flow at
34
+ * `/saml/idp/sso`. The login screen receives it as the `sso_state` query
35
+ * string parameter and must pass it back, byte for byte, on every call to
36
+ * this endpoint for the remainder of the login journey — including the
37
+ * second call that carries an `mfa_code`.
38
+ *
39
+ * The blob is signed, not encrypted, and it expires five minutes after the
40
+ * service provider's request arrives. Do not parse it, shorten it, decode
41
+ * it, or re-encode it.
42
+ *
43
+ * **An invalid blob does not fail the login.** This is the opposite of what
44
+ * most integrators assume, so it is worth stating plainly: a forged, edited
45
+ * or expired `sso_state` is silently discarded, and the request then
46
+ * proceeds as an ordinary login. Valid credentials still authenticate and
47
+ * still return `200` — just with no `sso` object, leaving the user signed in
48
+ * to Green Security with no way back to the service provider that sent them.
49
+ * Never treat a `200` as proof that the SSO hand-off survived; check for
50
+ * `sso` explicitly.
51
+ *
52
+ * Every `202` response echoes the *verified* blob back in its own
53
+ * `sso_state` field. Always send back the value from the response you just
54
+ * received rather than the one you started with, so that a blob the server
55
+ * has already rejected is never resent, and so a client does not have to
56
+ * hold state of its own across the login journey.
57
+ *
58
+ * Omit this field entirely for an ordinary login that did not originate
59
+ * from a service provider.
60
+ */
61
+ ssoState?: string | undefined;
29
62
  };
30
63
  /** @internal */
31
64
  export declare const MfaMethod$inboundSchema: z.ZodType<MfaMethod, z.ZodTypeDef, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"mfarequiredresponse.d.ts","sourceRoot":"","sources":["../../../../src/models/components/mfarequiredresponse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mB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G;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,UAAU,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAC7C,SAAS,EACT,CAAC,CAAC,UAAU,EACZ,OAAO,CAC6B,CAAC;AAEvC,gBAAgB;AAChB,eAAO,MAAM,iCAAiC,EAAE,CAAC,CAAC,OAAO,CACvD,mBAAmB,EACnB,CAAC,CAAC,UAAU,EACZ,OAAO,CAcP,CAAC;AAEH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,CAM1D"}
@@ -19,10 +19,12 @@ export const MfaRequiredResponse$inboundSchema = z.object({
19
19
  error: types.string(),
20
20
  mobile_phone: types.optional(types.string()),
21
21
  mfa_method: types.optional(MfaMethod$inboundSchema),
22
+ sso_state: types.optional(types.string()),
22
23
  }).transform((v) => {
23
24
  return remap$(v, {
24
25
  "mobile_phone": "mobilePhone",
25
26
  "mfa_method": "mfaMethod",
27
+ "sso_state": "ssoState",
26
28
  });
27
29
  });
28
30
  export function mfaRequiredResponseFromJSON(jsonString) {
@@ -1 +1 @@
1
- {"version":3,"file":"mfarequiredresponse.js","sourceRoot":"","sources":["../../../../src/models/components/mfarequiredresponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MA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,CAAC;AACJ,CAAC"}
@@ -12,9 +12,42 @@ export type PasswordNotSetResponse = {
12
12
  */
13
13
  error: string;
14
14
  /**
15
- * URL to redirect the user to set their password (forgot password flow). Includes return_url query param when provided in the request.
15
+ * URL to redirect the user to set their password (forgot password flow). Carries the `return_url` and `sso_state` query params when those were provided on the request, because the browser follows this redirect and leaves the JSON body behind.
16
16
  */
17
17
  redirectUrl: string;
18
+ /**
19
+ * Opaque, signed state that Green Security issues when a third-party service
20
+ *
21
+ * @remarks
22
+ * provider starts a "Login with Green Security" SAML flow at
23
+ * `/saml/idp/sso`. The login screen receives it as the `sso_state` query
24
+ * string parameter and must pass it back, byte for byte, on every call to
25
+ * this endpoint for the remainder of the login journey — including the
26
+ * second call that carries an `mfa_code`.
27
+ *
28
+ * The blob is signed, not encrypted, and it expires five minutes after the
29
+ * service provider's request arrives. Do not parse it, shorten it, decode
30
+ * it, or re-encode it.
31
+ *
32
+ * **An invalid blob does not fail the login.** This is the opposite of what
33
+ * most integrators assume, so it is worth stating plainly: a forged, edited
34
+ * or expired `sso_state` is silently discarded, and the request then
35
+ * proceeds as an ordinary login. Valid credentials still authenticate and
36
+ * still return `200` — just with no `sso` object, leaving the user signed in
37
+ * to Green Security with no way back to the service provider that sent them.
38
+ * Never treat a `200` as proof that the SSO hand-off survived; check for
39
+ * `sso` explicitly.
40
+ *
41
+ * Every `202` response echoes the *verified* blob back in its own
42
+ * `sso_state` field. Always send back the value from the response you just
43
+ * received rather than the one you started with, so that a blob the server
44
+ * has already rejected is never resent, and so a client does not have to
45
+ * hold state of its own across the login journey.
46
+ *
47
+ * Omit this field entirely for an ordinary login that did not originate
48
+ * from a service provider.
49
+ */
50
+ ssoState?: string | undefined;
18
51
  };
19
52
  /** @internal */
20
53
  export declare const PasswordNotSetResponse$inboundSchema: z.ZodType<PasswordNotSetResponse, z.ZodTypeDef, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"passwordnotsetresponse.d.ts","sourceRoot":"","sources":["../../../../src/models/components/passwordnotsetresponse.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;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,OAAO,CAC1D,sBAAsB,EACtB,CAAC,CAAC,UAAU,EACZ,OAAO,CAUP,CAAC;AAEH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAM7D"}
1
+ {"version":3,"file":"passwordnotsetresponse.d.ts","sourceRoot":"","sources":["../../../../src/models/components/passwordnotsetresponse.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;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,OAAO,CAC1D,sBAAsB,EACtB,CAAC,CAAC,UAAU,EACZ,OAAO,CAYP,CAAC;AAEH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAM7D"}
@@ -11,9 +11,11 @@ export const PasswordNotSetResponse$inboundSchema = z.object({
11
11
  success: types.boolean(),
12
12
  error: types.string(),
13
13
  redirect_url: types.string(),
14
+ sso_state: types.optional(types.string()),
14
15
  }).transform((v) => {
15
16
  return remap$(v, {
16
17
  "redirect_url": "redirectUrl",
18
+ "sso_state": "ssoState",
17
19
  });
18
20
  });
19
21
  export function passwordNotSetResponseFromJSON(jsonString) {
@@ -1 +1 @@
1
- {"version":3,"file":"passwordnotsetresponse.js","sourceRoot":"","sources":["../../../../src/models/components/passwordnotsetresponse.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;AAmBnD,gBAAgB;AAChB,MAAM,CAAC,MAAM,oCAAoC,GAI7C,CAAC,CAAC,MAAM,CAAC;IACX,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC;IACzC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;IACxB,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;IACrB,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,8BAA8B,CAC5C,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,oCAAoC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAChE,oDAAoD,CACrD,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"passwordnotsetresponse.js","sourceRoot":"","sources":["../../../../src/models/components/passwordnotsetresponse.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;AAoDnD,gBAAgB;AAChB,MAAM,CAAC,MAAM,oCAAoC,GAI7C,CAAC,CAAC,MAAM,CAAC;IACX,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC;IACzC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;IACxB,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;IACrB,YAAY,EAAE,KAAK,CAAC,MAAM,EAAE;IAC5B,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,cAAc,EAAE,aAAa;QAC7B,WAAW,EAAE,UAAU;KACxB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,8BAA8B,CAC5C,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,oCAAoC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAChE,oDAAoD,CACrD,CAAC;AACJ,CAAC"}
@@ -11,6 +11,39 @@ export type PasswordRequiredResponse = {
11
11
  * Error describing the exact condition of what further steps are needed to finish the login process.
12
12
  */
13
13
  error: string;
14
+ /**
15
+ * Opaque, signed state that Green Security issues when a third-party service
16
+ *
17
+ * @remarks
18
+ * provider starts a "Login with Green Security" SAML flow at
19
+ * `/saml/idp/sso`. The login screen receives it as the `sso_state` query
20
+ * string parameter and must pass it back, byte for byte, on every call to
21
+ * this endpoint for the remainder of the login journey — including the
22
+ * second call that carries an `mfa_code`.
23
+ *
24
+ * The blob is signed, not encrypted, and it expires five minutes after the
25
+ * service provider's request arrives. Do not parse it, shorten it, decode
26
+ * it, or re-encode it.
27
+ *
28
+ * **An invalid blob does not fail the login.** This is the opposite of what
29
+ * most integrators assume, so it is worth stating plainly: a forged, edited
30
+ * or expired `sso_state` is silently discarded, and the request then
31
+ * proceeds as an ordinary login. Valid credentials still authenticate and
32
+ * still return `200` — just with no `sso` object, leaving the user signed in
33
+ * to Green Security with no way back to the service provider that sent them.
34
+ * Never treat a `200` as proof that the SSO hand-off survived; check for
35
+ * `sso` explicitly.
36
+ *
37
+ * Every `202` response echoes the *verified* blob back in its own
38
+ * `sso_state` field. Always send back the value from the response you just
39
+ * received rather than the one you started with, so that a blob the server
40
+ * has already rejected is never resent, and so a client does not have to
41
+ * hold state of its own across the login journey.
42
+ *
43
+ * Omit this field entirely for an ordinary login that did not originate
44
+ * from a service provider.
45
+ */
46
+ ssoState?: string | undefined;
14
47
  };
15
48
  /** @internal */
16
49
  export declare const PasswordRequiredResponse$inboundSchema: z.ZodType<PasswordRequiredResponse, z.ZodTypeDef, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"passwordrequiredresponse.d.ts","sourceRoot":"","sources":["../../../../src/models/components/passwordrequiredresponse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,UAAU,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,sCAAsC,EAAE,CAAC,CAAC,OAAO,CAC5D,wBAAwB,EACxB,CAAC,CAAC,UAAU,EACZ,OAAO,CAKP,CAAC;AAEH,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,CAM/D"}
1
+ {"version":3,"file":"passwordrequiredresponse.d.ts","sourceRoot":"","sources":["../../../../src/models/components/passwordrequiredresponse.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;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,UAAU,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,sCAAsC,EAAE,CAAC,CAAC,OAAO,CAC5D,wBAAwB,EACxB,CAAC,CAAC,UAAU,EACZ,OAAO,CAUP,CAAC;AAEH,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,CAM/D"}
@@ -2,6 +2,7 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
  import * as z from "zod/v3";
5
+ import { remap as remap$ } from "../../lib/primitives.js";
5
6
  import { safeParse } from "../../lib/schemas.js";
6
7
  import * as types from "../../types/primitives.js";
7
8
  /** @internal */
@@ -9,6 +10,11 @@ export const PasswordRequiredResponse$inboundSchema = z.object({
9
10
  requires: types.literal("password"),
10
11
  success: types.boolean(),
11
12
  error: types.string(),
13
+ sso_state: types.optional(types.string()),
14
+ }).transform((v) => {
15
+ return remap$(v, {
16
+ "sso_state": "ssoState",
17
+ });
12
18
  });
13
19
  export function passwordRequiredResponseFromJSON(jsonString) {
14
20
  return safeParse(jsonString, (x) => PasswordRequiredResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PasswordRequiredResponse' from JSON`);
@@ -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;AAenD,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;CACtB,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"}
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;CAChB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,uCAAuC,EAAE,CAAC,CAAC,OAAO,CAC7D,yBAAyB,EACzB,CAAC,CAAC,UAAU,EACZ,OAAO,CAYP,CAAC;AAEH,wBAAgB,iCAAiC,CAC/C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,yBAAyB,EAAE,kBAAkB,CAAC,CAMhE"}
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;AAwBnD,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;CACxB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,kBAAkB,EAAE,iBAAiB;QACrC,SAAS,EAAE,QAAQ;KACpB,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"}
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.User | components.MfaRequiredResponse | components.SamlLoginRequiredResponse | components.PasswordRequiredResponse | components.PasswordNotSetResponse;
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,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AAM,sCAAsC,EAAE,CAAC,CAAC,OAAO,CAC5D,wBAAwB,EACxB,CAAC,CAAC,UAAU,EACZ,OAAO,CASP,CAAC;AAEH,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,CAM/D"}
@@ -25,7 +25,7 @@ export function postAuthenticateResponseBodyFromJSON(jsonString) {
25
25
  }
26
26
  /** @internal */
27
27
  export const PostAuthenticateResponse$inboundSchema = smartUnion([
28
- components.User$inboundSchema,
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,kBAAkB;IAC7B,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"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,CAAC,EAAE,mBAAmB,CAC3B,iCAAiC,EACjC,kCAAkC,EAClC,sCAAsC,CACvC,GACA,iBAAiB,CAClB,iCAAiC,EACjC,kCAAkC,EAClC,sCAAsC,CACvC,CAMA;AAED,wBAAgB,gCAAgC,IAAI,WAAW,CAE9D;AAED,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,iBAAiB,EAC1B,WAAW,CAAC,EAAE,cAAc,GAC3B;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,CACV,SAAS,EAAE,sCAAsC,KAC9C,OAAO,CAAC,iCAAiC,CAAC,CAAC;CACjD,CA0BA"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,CAAC,EAAE,mBAAmB,CAC3B,iCAAiC,EACjC,kCAAkC,EAClC,sCAAsC,CACvC,GACA,iBAAiB,CAClB,iCAAiC,EACjC,kCAAkC,EAClC,sCAAsC,CACvC,CAMA;AAED,wBAAgB,gCAAgC,IAAI,WAAW,CAE9D;AAED,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,iBAAiB,EAC1B,WAAW,CAAC,EAAE,cAAc,GAC3B;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,CACV,SAAS,EAAE,sCAAsC,KAC9C,OAAO,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;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"}
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,q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