使用AWSCognito在iOS / Swift上进行身份验证

时间:2019-04-03 08:40:08

标签: ios swift authentication amazon-cognito

我正在使用AWSCognito在iOS应用程序(在Swift中)中设置用户身份验证。 为此,我遵循了在网上找到的一些AWS文档和示例代码。

不幸的是,这似乎远没有使用Parse或Firebase那样简单。 我希望它也有一些好的方面。

这时,我有以下函数,该函数可以按我期望的方式调用和执行。但是我不确定从那里去哪里。

@objc func logInProcess() {
    if var userName = userNameInput.text, var password = paswdInput.text {
        password = password.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
        userName = userName.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)

        if (email.count != 0) && (password.count != 0) {
            let authDetails = AWSCognitoIdentityPasswordAuthenticationDetails(username: userName, 
                                                                              password: password)
            // What are we supposed to do here ??
        }
    }
}

调用 AWSCognitoIdentityPasswordAuthenticationDetails 时:

  • 我应该调用其他函数进行身份验证吗? (哪个功能?)
  • 或者我是否已经通过身份验证,例如,如何使用此身份验证来访问dynamoDB?

我找不到这些问题的明确答案。

0 个答案:

没有答案