You can manage such an integration by using the AWS SDK for PHP and writing a wordpress plugin that hooks into the authenticate call as described in the tutorial below:
[To see links please register here]
Instructions for installing the AWS SDK for PHP into your plugin can be found here (I followed the composer instructions to get it working):
[To see links please register here]
After that, a piece of code that deals just with User Pools authentication would be:
require 'vendor/autoload.php';
use Aws\CognitoIdentityProvider\CognitoIdentityProviderClient;
$cognitoIdentityProviderClient = new CognitoIdentityProviderClient(['version' => '2016-04-18',
'region' => 'us-east-1',
'credentials' => array(
'key' => get_option('aws_access_key_id'),
'secret' => get_option('aws_secret_access_key')
)]
);
$authResult = $cognitoIdentityProviderClient->adminInitiateAuth([
'AuthFlow' => 'ADMIN_NO_SRP_AUTH',
'UserPoolId' => get_option('cognito_userpoolid'),
'ClientId' => get_option('cognito_clientid'),
'AuthParameters' => ['USERNAME' => $username, 'PASSWORD' => $password],
]);
This is an authenticated call so it requires AWS credentials as you can see in my code above for the placeholders aws_access_key_id and aws_secret_access_key. Here is a link to AWS documentation for managing credentials in PHP:
[To see links please register here]