@@ -34,24 +34,48 @@ final class AdminInitiateAuthRequest extends Input
3434 private $ clientId ;
3535
3636 /**
37- * The authentication flow for this call to run. The API action will depend on this value. For example:
37+ * The authentication flow that you want to initiate. The `AuthParameters` that you must submit are linked to the flow
38+ * that you submit. For example:
3839 *
39- * - `REFRESH_TOKEN_AUTH` will take in a valid refresh token and return new tokens.
40- * - `USER_SRP_AUTH` will take in `USERNAME` and `SRP_A` and return the Secure Remote Password (SRP) protocol variables
41- * to be used for next challenge execution.
42- * - `ADMIN_USER_PASSWORD_AUTH` will take in `USERNAME` and `PASSWORD` and return the next challenge or tokens.
40+ * - `USER_AUTH`: Request a preferred authentication type or review available authentication types. From the offered
41+ * authentication types, select one in a challenge response and then authenticate with that method in an additional
42+ * challenge response.
43+ * - `REFRESH_TOKEN_AUTH`: Receive new ID and access tokens when you pass a `REFRESH_TOKEN` parameter with a valid
44+ * refresh token as the value.
45+ * - `USER_SRP_AUTH`: Receive secure remote password (SRP) variables for the next challenge, `PASSWORD_VERIFIER`, when
46+ * you pass `USERNAME` and `SRP_A` parameters..
47+ * - `ADMIN_USER_PASSWORD_AUTH`: Receive new tokens or the next challenge, for example `SOFTWARE_TOKEN_MFA`, when you
48+ * pass `USERNAME` and `PASSWORD` parameters.
4349 *
44- * Valid values include:
50+ * Valid values include the following :
4551 *
46- * - `USER_SRP_AUTH`: Authentication flow for the Secure Remote Password (SRP) protocol.
47- * - `REFRESH_TOKEN_AUTH`/`REFRESH_TOKEN`: Authentication flow for refreshing the access token and ID token by supplying
48- * a valid refresh token.
49- * - `CUSTOM_AUTH`: Custom authentication flow.
50- * - `ADMIN_NO_SRP_AUTH`: Non-SRP authentication flow; you can pass in the USERNAME and PASSWORD directly if the flow is
51- * enabled for calling the app client.
52- * - `ADMIN_USER_PASSWORD_AUTH`: Admin-based user password authentication. This replaces the `ADMIN_NO_SRP_AUTH`
53- * authentication flow. In this flow, Amazon Cognito receives the password in the request instead of using the SRP
54- * process to verify passwords.
52+ * - `USER_AUTH`:
53+ *
54+ * The entry point for sign-in with passwords, one-time passwords, biometric devices, and security keys.
55+ * - `USER_SRP_AUTH`:
56+ *
57+ * Username-password authentication with the Secure Remote Password (SRP) protocol. For more information, see Use SRP
58+ * password verification in custom authentication flow [^1].
59+ * - `REFRESH_TOKEN_AUTH and REFRESH_TOKEN`:
60+ *
61+ * Provide a valid refresh token and receive new ID and access tokens. For more information, see Using the refresh
62+ * token [^2].
63+ * - `CUSTOM_AUTH`:
64+ *
65+ * Custom authentication with Lambda triggers. For more information, see Custom authentication challenge Lambda
66+ * triggers [^3].
67+ * - `ADMIN_USER_PASSWORD_AUTH`:
68+ *
69+ * Username-password authentication with the password sent directly in the request. For more information, see Admin
70+ * authentication flow [^4].
71+ *
72+ * `USER_PASSWORD_AUTH` is a flow type of InitiateAuth [^5] and isn't valid for AdminInitiateAuth.
73+ *
74+ * [^1]: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-authentication-flow.html#Using-SRP-password-verification-in-custom-authentication-flow
75+ * [^2]: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-the-refresh-token.html
76+ * [^3]: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-challenge.html
77+ * [^4]: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-authentication-flow.html#Built-in-authentication-flow-and-challenges
78+ * [^5]: https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_InitiateAuth.html
5579 *
5680 * @required
5781 *
@@ -63,6 +87,9 @@ final class AdminInitiateAuthRequest extends Input
6387 * The authentication parameters. These are inputs corresponding to the `AuthFlow` that you're invoking. The required
6488 * values depend on the value of `AuthFlow`:
6589 *
90+ * - For `USER_AUTH`: `USERNAME` (required), `PREFERRED_CHALLENGE`. If you don't provide a value for
91+ * `PREFERRED_CHALLENGE`, Amazon Cognito responds with the `AvailableChallenges` parameter that specifies the
92+ * available sign-in methods.
6693 * - For `USER_SRP_AUTH`: `USERNAME` (required), `SRP_A` (required), `SECRET_HASH` (required if the app client is
6794 * configured with a client secret), `DEVICE_KEY`.
6895 * - For `ADMIN_USER_PASSWORD_AUTH`: `USERNAME` (required), `PASSWORD` (required), `SECRET_HASH` (required if the app
@@ -107,6 +134,8 @@ final class AdminInitiateAuthRequest extends Input
107134 * - Pre token generation
108135 * - Create auth challenge
109136 * - Define auth challenge
137+ * - Custom email sender
138+ * - Custom SMS sender
110139 *
111140 * For more information, see Customizing user pool Workflows with Lambda Triggers [^1] in the *Amazon Cognito Developer
112141 * Guide*.
@@ -142,6 +171,14 @@ final class AdminInitiateAuthRequest extends Input
142171 */
143172 private $ contextData ;
144173
174+ /**
175+ * The optional session ID from a `ConfirmSignUp` API request. You can sign in a user directly from the sign-up process
176+ * with the `USER_AUTH` authentication flow.
177+ *
178+ * @var string|null
179+ */
180+ private $ session ;
181+
145182 /**
146183 * @param array{
147184 * UserPoolId?: string,
@@ -151,6 +188,7 @@ final class AdminInitiateAuthRequest extends Input
151188 * ClientMetadata?: null|array<string, string>,
152189 * AnalyticsMetadata?: null|AnalyticsMetadataType|array,
153190 * ContextData?: null|ContextDataType|array,
191+ * Session?: null|string,
154192 * '@region'?: string|null,
155193 * } $input
156194 */
@@ -163,6 +201,7 @@ public function __construct(array $input = [])
163201 $ this ->clientMetadata = $ input ['ClientMetadata ' ] ?? null ;
164202 $ this ->analyticsMetadata = isset ($ input ['AnalyticsMetadata ' ]) ? AnalyticsMetadataType::create ($ input ['AnalyticsMetadata ' ]) : null ;
165203 $ this ->contextData = isset ($ input ['ContextData ' ]) ? ContextDataType::create ($ input ['ContextData ' ]) : null ;
204+ $ this ->session = $ input ['Session ' ] ?? null ;
166205 parent ::__construct ($ input );
167206 }
168207
@@ -175,6 +214,7 @@ public function __construct(array $input = [])
175214 * ClientMetadata?: null|array<string, string>,
176215 * AnalyticsMetadata?: null|AnalyticsMetadataType|array,
177216 * ContextData?: null|ContextDataType|array,
217+ * Session?: null|string,
178218 * '@region'?: string|null,
179219 * }|AdminInitiateAuthRequest $input
180220 */
@@ -222,6 +262,11 @@ public function getContextData(): ?ContextDataType
222262 return $ this ->contextData ;
223263 }
224264
265+ public function getSession (): ?string
266+ {
267+ return $ this ->session ;
268+ }
269+
225270 public function getUserPoolId (): ?string
226271 {
227272 return $ this ->userPoolId ;
@@ -304,6 +349,13 @@ public function setContextData(?ContextDataType $value): self
304349 return $ this ;
305350 }
306351
352+ public function setSession (?string $ value ): self
353+ {
354+ $ this ->session = $ value ;
355+
356+ return $ this ;
357+ }
358+
307359 public function setUserPoolId (?string $ value ): self
308360 {
309361 $ this ->userPoolId = $ value ;
@@ -355,6 +407,9 @@ private function requestBody(): array
355407 if (null !== $ v = $ this ->contextData ) {
356408 $ payload ['ContextData ' ] = $ v ->requestBody ();
357409 }
410+ if (null !== $ v = $ this ->session ) {
411+ $ payload ['Session ' ] = $ v ;
412+ }
358413
359414 return $ payload ;
360415 }
0 commit comments