@@ -152,18 +152,21 @@ export class UserPoolDomain extends Resource implements IUserPoolDomain {
152
152
153
153
/**
154
154
* The URL to the hosted UI associated with this domain
155
+ *
156
+ * @param options options to customize baseUrl
155
157
*/
156
- public baseUrl ( ) : string {
158
+ public baseUrl ( options ?: BaseUrlOptions ) : string {
157
159
if ( this . isCognitoDomain ) {
158
- return `https://${ this . domainName } .auth.${ Stack . of ( this ) . region } .amazoncognito.com` ;
160
+ const authDomain = 'auth' + ( options ?. fips ? '-fips' : '' ) ;
161
+ return `https://${ this . domainName } .${ authDomain } .${ Stack . of ( this ) . region } .amazoncognito.com` ;
159
162
}
160
163
return `https://${ this . domainName } ` ;
161
164
}
162
165
163
166
/**
164
167
* The URL to the sign in page in this domain using a specific UserPoolClient
165
168
* @param client [disable-awslint:ref-via-interface] the user pool client that the UI will use to interact with the UserPool
166
- * @param options options to customize the behaviour of this method .
169
+ * @param options options to customize signInUrl .
167
170
*/
168
171
public signInUrl ( client : UserPoolClient , options : SignInUrlOptions ) : string {
169
172
let responseType : string ;
@@ -175,14 +178,26 @@ export class UserPoolDomain extends Resource implements IUserPoolDomain {
175
178
throw new Error ( 'signInUrl is not supported for clients without authorizationCodeGrant or implicitCodeGrant flow enabled' ) ;
176
179
}
177
180
const path = options . signInPath ?? '/login' ;
178
- return `${ this . baseUrl ( ) } ${ path } ?client_id=${ client . userPoolClientId } &response_type=${ responseType } &redirect_uri=${ options . redirectUri } ` ;
181
+ return `${ this . baseUrl ( options ) } ${ path } ?client_id=${ client . userPoolClientId } &response_type=${ responseType } &redirect_uri=${ options . redirectUri } ` ;
179
182
}
180
183
}
181
184
185
+ /**
186
+ * Options to customize the behaviour of `baseUrl()`
187
+ */
188
+ export interface BaseUrlOptions {
189
+ /**
190
+ * Whether to return the FIPS-compliant endpoint
191
+ *
192
+ * @default return the standard URL
193
+ */
194
+ readonly fips ?: boolean ;
195
+ }
196
+
182
197
/**
183
198
* Options to customize the behaviour of `signInUrl()`
184
199
*/
185
- export interface SignInUrlOptions {
200
+ export interface SignInUrlOptions extends BaseUrlOptions {
186
201
/**
187
202
* Where to redirect to after sign in
188
203
*/
0 commit comments