getSigningCertificate method
Given a user pool ID, returns the signing certificate for SAML 2.0 federation.
Issued certificates are valid for 10 years from the date of issue. Amazon
Cognito issues and assigns a new signing certificate annually. This
renewal process returns a new value in the response to
GetSigningCertificate, but doesn't invalidate the original
certificate.
For more information, see Signing SAML requests.
Learn more
- Signing Amazon Web Services API Requests
- Using the Amazon Cognito user pools API and user pool endpoints
May throw InternalErrorException.
May throw InvalidParameterException.
May throw OperationNotEnabledException.
May throw ResourceNotFoundException.
Parameter userPoolId :
The ID of the user pool where you want to view the signing certificate.
Implementation
Future<GetSigningCertificateResponse> getSigningCertificate({
required String userPoolId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSCognitoIdentityProviderService.GetSigningCertificate'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'UserPoolId': userPoolId,
},
);
return GetSigningCertificateResponse.fromJson(jsonResponse.body);
}