使用ListUsers API或iOS SDK搜索用户Amazon Cognito [英] Search users Amazon Cognito with ListUsers API or iOS SDK

查看:159
本文介绍了使用ListUsers API或iOS SDK搜索用户Amazon Cognito的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Swift中创建一个iOS应用程序,但找不到使用API​​搜索或获取Cognito用户列表的方法。根据Amazon Documentation,它说使用ListUsers API;但是,它不提供发出请求的终结点,并且很难通过AWS认证REST API请求,因此是否可以通过iOS SDK进行此操作?这些是我想包含在请求中的参数。

I am creating an iOS application in Swift and I cannot find a way to search or get a list of Cognito Users with API. Per Amazon Documentation, it says to use the ListUsers API; however, it does not provide an endpoint to make the request and it is rather difficult to authenticate REST API requests with AWS so is there anyway to do this via iOS SDK? These are the parameters I would like to include in my Request.

[
        "AttributesToGet": ["username" ],
        "Filter": "username ^= \"micheal\"",
        "Limit": 10,
        "UserPoolId": "\(AWSCognitoUserPoolId)"
    ]


推荐答案

您必须搜索Mobile SDK。

You have to search through the Mobile SDK.

对于iOS

 // Make a AWSCognitoListUsers Request
    let getUsersRequest = AWSCognitoIdentityProviderListUsersRequest()

    // Add the Parameters
    //getUsersRequest?.attributesToGet = ["username"]
    getUsersRequest?.userPoolId = AWSCognitoUserPoolId

    // Make the Request
    AWSCognitoIdentityProvider(forKey: AWSCognitoUserPoolId).listUsers(getUsersRequest!, completionHandler: { (response, error) in


        // The response variable contains the Cognito Response

    })

这篇关于使用ListUsers API或iOS SDK搜索用户Amazon Cognito的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆