douzhi4056 2019-04-04 20:34
浏览 92

可以使用AWS SDK for PHP版本2作为Cognito用户池用户登录吗?

I'm trying to write some code in our PHP application that currently uses the AWS SDK for PHP version 2.8.31 to essentially sign in a user that's in a Cognito User Pool so that we can then use that user's identity to call AWS API Lambda methods. The API Gateway will use Cognito as the authorizer.

The problem I'm having is that all the examples I'm finding online for getting this done are using version 3 of the PHP SDK that has the CognitoIdentityProviderClient class that provides the adminInitiateAuth method that gets the Access Token that you need to call the API Gateway with.

Is there a way to do this with the v2 of the AWS SDK for PHP (https://docs.aws.amazon.com/aws-sdk-php/v2/guide/)?

The CognitoIdentityClient seems like it might be the way, but the only relevant methods I see are getId and then getCredentialsForIdentity, but these still don't get me the Access Token I need to pass to the API Gateway. I can also see GetOpenIdToken and GetOpenIdTokenForDeveloperIdentity but the 'IdentityProviderName' parameter that they are asking for doesn't seem to support Cognito User Pool as the provider?

I'm just hoping that someone out there knows a enough about these methods to let me know if this is even possible with the V2 of the SDK.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 个人网站被恶意大量访问,怎么办
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大