DataFlex
DataFlex
Amazon Cognito - Describe User Pool
See more Amazon Cognito Examples
Returns the configuration information and metadata of the specified user pool.Chilkat DataFlex Downloads
Use ChilkatAx-win32.pkg
Procedure Test
Boolean iSuccess
Handle hoRest
Variant vAuthAws
Handle hoAuthAws
Boolean iBTls
Integer iPort
Boolean iBAutoReconnect
Handle hoJson
Variant vSbRequestBody
Handle hoSbRequestBody
Variant vSbResponseBody
Handle hoSbResponseBody
Integer iRespStatusCode
Handle hoJsonResponse
String sName
Integer iPriority
String sStrVal
String sAttributeDataType
Boolean iDeveloperOnlyAttribute
Boolean iMutable
Boolean iRequired
String sStringAttributeConstraintsMaxLength
String sStringAttributeConstraintsMinLength
String sNumberAttributeConstraintsMinValue
Boolean iUserPoolAdminCreateUserConfigAllowAdminCreateUserOnly
String sUserPoolAdminCreateUserConfigInviteMessageTemplateEmailMessage
String sUserPoolAdminCreateUserConfigInviteMessageTemplateEmailSubject
String sUserPoolAdminCreateUserConfigInviteMessageTemplateSMSMessage
Integer iUserPoolAdminCreateUserConfigUnusedAccountValidityDays
String sUserPoolArn
String sUserPoolCreationDate
String sUserPoolEmailConfigurationEmailSendingAccount
String sUserPoolEmailConfigurationFrom
String sUserPoolEmailConfigurationReplyToEmailAddress
String sUserPoolEmailConfigurationSourceArn
String sUserPoolEmailVerificationMessage
String sUserPoolEmailVerificationSubject
Integer iUserPoolEstimatedNumberOfUsers
String sUserPoolId
String sUserPoolLastModifiedDate
String sUserPoolMfaConfiguration
String sUserPoolName
Integer iUserPoolPoliciesPasswordPolicyMinimumLength
Boolean iUserPoolPoliciesPasswordPolicyRequireLowercase
Boolean iUserPoolPoliciesPasswordPolicyRequireNumbers
Boolean iUserPoolPoliciesPasswordPolicyRequireSymbols
Boolean iUserPoolPoliciesPasswordPolicyRequireUppercase
Integer iUserPoolPoliciesPasswordPolicyTemporaryPasswordValidityDays
String sUserPoolSmsAuthenticationMessage
String sUserPoolSmsConfigurationExternalId
String sUserPoolSmsConfigurationSnsCallerArn
String sUserPoolSmsVerificationMessage
String sUserPoolUserPoolTagsSampleUserPoolTag
Boolean iUserPoolUsernameConfigurationCaseSensitive
String sUserPoolVerificationMessageTemplateDefaultEmailOption
String sUserPoolVerificationMessageTemplateEmailMessage
String sUserPoolVerificationMessageTemplateEmailSubject
String sUserPoolVerificationMessageTemplateSmsMessage
Integer i
Integer iCount_i
String sTemp1
Integer iTemp1
Move False To iSuccess
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatRest)) To hoRest
If (Not(IsComObjectCreated(hoRest))) Begin
Send CreateComObject of hoRest
End
Get Create (RefClass(cComChilkatAuthAws)) To hoAuthAws
If (Not(IsComObjectCreated(hoAuthAws))) Begin
Send CreateComObject of hoAuthAws
End
Set ComAccessKey Of hoAuthAws To "AWS_ACCESS_KEY"
Set ComSecretKey Of hoAuthAws To "AWS_SECRET_KEY"
// Don't forget to change the region to your particular region. (Also make the same change in the call to Connect below.)
Set ComRegion Of hoAuthAws To "us-west-2"
Set ComServiceName Of hoAuthAws To "cognito-idp"
// SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
Get pvComObject of hoAuthAws to vAuthAws
Get ComSetAuthAws Of hoRest vAuthAws To iSuccess
// URL: https://cognito-idp.us-west-2.amazonaws.com/
Move True To iBTls
Move 443 To iPort
Move True To iBAutoReconnect
// Use the same region as specified above.
Get ComConnect Of hoRest "cognito-idp.us-west-2.amazonaws.com" iPort iBTls iBAutoReconnect To iSuccess
If (iSuccess <> True) Begin
Get ComConnectFailReason Of hoRest To iTemp1
Showln "ConnectFailReason: " iTemp1
Get ComLastErrorText Of hoRest To sTemp1
Showln sTemp1
Procedure_Return
End
// Note: The above code does not need to be repeatedly called for each REST request.
// The rest object can be setup once, and then many requests can be sent. Chilkat will automatically
// reconnect within a FullRequest* method as needed. It is only the very first connection that is explicitly
// made via the Connect method.
Get Create (RefClass(cComChilkatJsonObject)) To hoJson
If (Not(IsComObjectCreated(hoJson))) Begin
Send CreateComObject of hoJson
End
Get ComUpdateString Of hoJson "UserPoolId" "us-west-2_yt6WzO3SA" To iSuccess
Get ComAddHeader Of hoRest "Content-Type" "application/x-amz-json-1.0" To iSuccess
Get ComAddHeader Of hoRest "X-Amz-Target" "AWSCognitoIdentityProviderService.DescribeUserPool" To iSuccess
Get ComAddHeader Of hoRest "Accept-Encoding" "identity" To iSuccess
Get Create (RefClass(cComChilkatStringBuilder)) To hoSbRequestBody
If (Not(IsComObjectCreated(hoSbRequestBody))) Begin
Send CreateComObject of hoSbRequestBody
End
Get pvComObject of hoSbRequestBody to vSbRequestBody
Get ComEmitSb Of hoJson vSbRequestBody To iSuccess
Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
Send CreateComObject of hoSbResponseBody
End
Get pvComObject of hoSbRequestBody to vSbRequestBody
Get pvComObject of hoSbResponseBody to vSbResponseBody
Get ComFullRequestSb Of hoRest "POST" "/" vSbRequestBody vSbResponseBody To iSuccess
If (iSuccess <> True) Begin
Get ComLastErrorText Of hoRest To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComResponseStatusCode Of hoRest To iRespStatusCode
Showln "response status code = " iRespStatusCode
If (iRespStatusCode <> 200) Begin
Showln "Response Status Code = " iRespStatusCode
Showln "Response Header:"
Get ComResponseHeader Of hoRest To sTemp1
Showln sTemp1
Showln "Response Body:"
Get ComGetAsString Of hoSbResponseBody To sTemp1
Showln sTemp1
Procedure_Return
End
Get Create (RefClass(cComChilkatJsonObject)) To hoJsonResponse
If (Not(IsComObjectCreated(hoJsonResponse))) Begin
Send CreateComObject of hoJsonResponse
End
Get pvComObject of hoSbResponseBody to vSbResponseBody
Get ComLoadSb Of hoJsonResponse vSbResponseBody To iSuccess
Set ComEmitCompact Of hoJsonResponse To False
Get ComEmit Of hoJsonResponse To sTemp1
Showln sTemp1
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// Use this online tool to generate parsing code from sample JSON:
// Generate Parsing Code from JSON
// {
// "UserPool": {
// "AccountRecoverySetting": {
// "RecoveryMechanisms": [
// {
// "Name": "verified_phone_number",
// "Priority": 1
// },
// {
// "Name": "verified_email",
// "Priority": 2
// }
// ]
// },
// "AdminCreateUserConfig": {
// "AllowAdminCreateUserOnly": false,
// "InviteMessageTemplate": {
// "EmailMessage": "Your username is {username} and temporary password is {####}. ",
// "EmailSubject": "Your temporary password",
// "SMSMessage": "Your username is {username} and temporary password is {####}. "
// },
// "UnusedAccountValidityDays": 7
// },
// "Arn": "arn:aws:cognito-idp:us-west-2:954491834127:userpool/us-west-2_yt6WzO3SA",
// "AutoVerifiedAttributes": [
// "email",
// "phone_number"
// ],
// "CreationDate": 1.636388909817E9,
// "EmailConfiguration": {
// "EmailSendingAccount": "DEVELOPER",
// "From": "admin@chilkatsoft.com",
// "ReplyToEmailAddress": "admin@chilkatsoft.com",
// "SourceArn": "arn:aws:ses:us-west-2:954491834127:identity/admin@chilkatsoft.com"
// },
// "EmailVerificationMessage": "Your verification code is {####}. ",
// "EmailVerificationSubject": "Your verification code",
// "EstimatedNumberOfUsers": 0,
// "Id": "us-west-2_yt6WzO3SA",
// "LambdaConfig": {},
// "LastModifiedDate": 1.636388910377E9,
// "MfaConfiguration": "ON",
// "Name": "chilkat",
// "Policies": {
// "PasswordPolicy": {
// "MinimumLength": 8,
// "RequireLowercase": true,
// "RequireNumbers": true,
// "RequireSymbols": true,
// "RequireUppercase": true,
// "TemporaryPasswordValidityDays": 7
// }
// },
// "SchemaAttributes": [
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": false,
// "Name": "sub",
// "Required": true,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "1"
// }
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "name",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "given_name",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "family_name",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "middle_name",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "nickname",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "preferred_username",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "profile",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "picture",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "website",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "email",
// "Required": true,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "Boolean",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "email_verified",
// "Required": false
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "gender",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "birthdate",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "10",
// "MinLength": "10"
// }
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "zoneinfo",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "locale",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "phone_number",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "Boolean",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "phone_number_verified",
// "Required": false
// },
// {
// "AttributeDataType": "String",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "address",
// "Required": false,
// "StringAttributeConstraints": {
// "MaxLength": "2048",
// "MinLength": "0"
// }
// },
// {
// "AttributeDataType": "Number",
// "DeveloperOnlyAttribute": false,
// "Mutable": true,
// "Name": "updated_at",
// "NumberAttributeConstraints": {
// "MinValue": "0"
// },
// "Required": false
// }
// ],
// "SmsAuthenticationMessage": "Your verification code is {####}. ",
// "SmsConfiguration": {
// "ExternalId": "94b17737-216b-4cf7-a29e-17e990e91300",
// "SnsCallerArn": "arn:aws:iam::954491834127:role/service-role/chilkat-SMS-Role"
// },
// "SmsVerificationMessage": "Your verification code is {####}. ",
// "UserPoolTags": {
// "sampleUserPoolTag": "test"
// },
// "UsernameConfiguration": {
// "CaseSensitive": false
// },
// "VerificationMessageTemplate": {
// "DefaultEmailOption": "CONFIRM_WITH_CODE",
// "EmailMessage": "Your verification code is {####}. ",
// "EmailSubject": "Your verification code",
// "SmsMessage": "Your verification code is {####}. "
// }
// }
// }
Get ComBoolOf Of hoJsonResponse "UserPool.AdminCreateUserConfig.AllowAdminCreateUserOnly" To iUserPoolAdminCreateUserConfigAllowAdminCreateUserOnly
Get ComStringOf Of hoJsonResponse "UserPool.AdminCreateUserConfig.InviteMessageTemplate.EmailMessage" To sUserPoolAdminCreateUserConfigInviteMessageTemplateEmailMessage
Get ComStringOf Of hoJsonResponse "UserPool.AdminCreateUserConfig.InviteMessageTemplate.EmailSubject" To sUserPoolAdminCreateUserConfigInviteMessageTemplateEmailSubject
Get ComStringOf Of hoJsonResponse "UserPool.AdminCreateUserConfig.InviteMessageTemplate.SMSMessage" To sUserPoolAdminCreateUserConfigInviteMessageTemplateSMSMessage
Get ComIntOf Of hoJsonResponse "UserPool.AdminCreateUserConfig.UnusedAccountValidityDays" To iUserPoolAdminCreateUserConfigUnusedAccountValidityDays
Get ComStringOf Of hoJsonResponse "UserPool.Arn" To sUserPoolArn
Get ComStringOf Of hoJsonResponse "UserPool.CreationDate" To sUserPoolCreationDate
Get ComStringOf Of hoJsonResponse "UserPool.EmailConfiguration.EmailSendingAccount" To sUserPoolEmailConfigurationEmailSendingAccount
Get ComStringOf Of hoJsonResponse "UserPool.EmailConfiguration.From" To sUserPoolEmailConfigurationFrom
Get ComStringOf Of hoJsonResponse "UserPool.EmailConfiguration.ReplyToEmailAddress" To sUserPoolEmailConfigurationReplyToEmailAddress
Get ComStringOf Of hoJsonResponse "UserPool.EmailConfiguration.SourceArn" To sUserPoolEmailConfigurationSourceArn
Get ComStringOf Of hoJsonResponse "UserPool.EmailVerificationMessage" To sUserPoolEmailVerificationMessage
Get ComStringOf Of hoJsonResponse "UserPool.EmailVerificationSubject" To sUserPoolEmailVerificationSubject
Get ComIntOf Of hoJsonResponse "UserPool.EstimatedNumberOfUsers" To iUserPoolEstimatedNumberOfUsers
Get ComStringOf Of hoJsonResponse "UserPool.Id" To sUserPoolId
Get ComStringOf Of hoJsonResponse "UserPool.LastModifiedDate" To sUserPoolLastModifiedDate
Get ComStringOf Of hoJsonResponse "UserPool.MfaConfiguration" To sUserPoolMfaConfiguration
Get ComStringOf Of hoJsonResponse "UserPool.Name" To sUserPoolName
Get ComIntOf Of hoJsonResponse "UserPool.Policies.PasswordPolicy.MinimumLength" To iUserPoolPoliciesPasswordPolicyMinimumLength
Get ComBoolOf Of hoJsonResponse "UserPool.Policies.PasswordPolicy.RequireLowercase" To iUserPoolPoliciesPasswordPolicyRequireLowercase
Get ComBoolOf Of hoJsonResponse "UserPool.Policies.PasswordPolicy.RequireNumbers" To iUserPoolPoliciesPasswordPolicyRequireNumbers
Get ComBoolOf Of hoJsonResponse "UserPool.Policies.PasswordPolicy.RequireSymbols" To iUserPoolPoliciesPasswordPolicyRequireSymbols
Get ComBoolOf Of hoJsonResponse "UserPool.Policies.PasswordPolicy.RequireUppercase" To iUserPoolPoliciesPasswordPolicyRequireUppercase
Get ComIntOf Of hoJsonResponse "UserPool.Policies.PasswordPolicy.TemporaryPasswordValidityDays" To iUserPoolPoliciesPasswordPolicyTemporaryPasswordValidityDays
Get ComStringOf Of hoJsonResponse "UserPool.SmsAuthenticationMessage" To sUserPoolSmsAuthenticationMessage
Get ComStringOf Of hoJsonResponse "UserPool.SmsConfiguration.ExternalId" To sUserPoolSmsConfigurationExternalId
Get ComStringOf Of hoJsonResponse "UserPool.SmsConfiguration.SnsCallerArn" To sUserPoolSmsConfigurationSnsCallerArn
Get ComStringOf Of hoJsonResponse "UserPool.SmsVerificationMessage" To sUserPoolSmsVerificationMessage
Get ComStringOf Of hoJsonResponse "UserPool.UserPoolTags.sampleUserPoolTag" To sUserPoolUserPoolTagsSampleUserPoolTag
Get ComBoolOf Of hoJsonResponse "UserPool.UsernameConfiguration.CaseSensitive" To iUserPoolUsernameConfigurationCaseSensitive
Get ComStringOf Of hoJsonResponse "UserPool.VerificationMessageTemplate.DefaultEmailOption" To sUserPoolVerificationMessageTemplateDefaultEmailOption
Get ComStringOf Of hoJsonResponse "UserPool.VerificationMessageTemplate.EmailMessage" To sUserPoolVerificationMessageTemplateEmailMessage
Get ComStringOf Of hoJsonResponse "UserPool.VerificationMessageTemplate.EmailSubject" To sUserPoolVerificationMessageTemplateEmailSubject
Get ComStringOf Of hoJsonResponse "UserPool.VerificationMessageTemplate.SmsMessage" To sUserPoolVerificationMessageTemplateSmsMessage
Move 0 To i
Get ComSizeOfArray Of hoJsonResponse "UserPool.AccountRecoverySetting.RecoveryMechanisms" To iCount_i
While (i < iCount_i)
Set ComI Of hoJsonResponse To i
Get ComStringOf Of hoJsonResponse "UserPool.AccountRecoverySetting.RecoveryMechanisms[i].Name" To sName
Get ComIntOf Of hoJsonResponse "UserPool.AccountRecoverySetting.RecoveryMechanisms[i].Priority" To iPriority
Move (i + 1) To i
Loop
Move 0 To i
Get ComSizeOfArray Of hoJsonResponse "UserPool.AutoVerifiedAttributes" To iCount_i
While (i < iCount_i)
Set ComI Of hoJsonResponse To i
Get ComStringOf Of hoJsonResponse "UserPool.AutoVerifiedAttributes[i]" To sStrVal
Move (i + 1) To i
Loop
Move 0 To i
Get ComSizeOfArray Of hoJsonResponse "UserPool.SchemaAttributes" To iCount_i
While (i < iCount_i)
Set ComI Of hoJsonResponse To i
Get ComStringOf Of hoJsonResponse "UserPool.SchemaAttributes[i].AttributeDataType" To sAttributeDataType
Get ComBoolOf Of hoJsonResponse "UserPool.SchemaAttributes[i].DeveloperOnlyAttribute" To iDeveloperOnlyAttribute
Get ComBoolOf Of hoJsonResponse "UserPool.SchemaAttributes[i].Mutable" To iMutable
Get ComStringOf Of hoJsonResponse "UserPool.SchemaAttributes[i].Name" To sName
Get ComBoolOf Of hoJsonResponse "UserPool.SchemaAttributes[i].Required" To iRequired
Get ComStringOf Of hoJsonResponse "UserPool.SchemaAttributes[i].StringAttributeConstraints.MaxLength" To sStringAttributeConstraintsMaxLength
Get ComStringOf Of hoJsonResponse "UserPool.SchemaAttributes[i].StringAttributeConstraints.MinLength" To sStringAttributeConstraintsMinLength
Get ComStringOf Of hoJsonResponse "UserPool.SchemaAttributes[i].NumberAttributeConstraints.MinValue" To sNumberAttributeConstraintsMinValue
Move (i + 1) To i
Loop
End_Procedure