使用iOS SDK Cognito Lambda和DynamoDB为AWS iOS创建用户/开发人员定义的登录名 [英] Creating a user/developer defined login for AWS iOS using iOS SDK Cognito Lambda and DynamoDB

查看:89
本文介绍了使用iOS SDK Cognito Lambda和DynamoDB为AWS iOS创建用户/开发人员定义的登录名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚这是否是使用AWS为iOS开发用户/开发人员定义的登录凭证的正确 /当前/正确流程。

I am trying to figure out if this is the "proper"/current/correct flow for developing a user/developer defined login credential for iOS using AWS.

(我从Parse迁移到AWS,所以只读了一周的AWS)。

(I am migrating from Parse to AWS so only been reading AWS for a week).


  1. 下载,安装并构建iOS应用注册用户(例如,电子邮件和密码(此操作已完成,应用程序显示了一个用于电子邮件和密码的UITextField,可在UIViewController中访问))。还可以通过Cocoapods安装iOS SDK并可用。

  2. 创建一个具有unauth和auth角色的身份池,以访问不同的服务。因此,从技术上讲,未经身份验证将可以访问他们所需的内容。取消授权将访问DynamoDB的完全访问权限和Cognito。 Auth添加了s3和sns。这个做完了。是否需要添加Lambda? (均在IAM和Cognito中设置)。

  3. 使用Lambda创建要从iOS设备调用的函数,以查看用户是否已在DynamoDB中注册。

  4. 如果用户已注册,并且与Lambda对DynamoDB的呼叫匹配,请使用Cognito从取消身份验证角色切换为身份验证。

  5. 现在,用户已通过身份验证,可以访问S3,SNS和其他服务。

  1. Download, install, and build an iOS app for registering users (say email and password (this is done and the app shows a UITextField for email and password and accessible in the UIViewController)). Also iOS SDK via Cocoapods is installed and available.
  2. Create an identity pool with an unauth and auth roles that access the different services. So unauth technically will access what they need. Unauth accesses DynamoDB full access and Cognito. Auth adds in s3 and sns. This is done. Does Lambda needed to be added? (all set up in IAM and Cognito).
  3. Use Lambda to create functions to be called from the iOS device to see if a user is register in DynamoDB.
  4. If user is registered and matched against Lambda's call to DynamoDB, use Cognito to switch from unauth role to auth.
  5. Now user is authenticated and can get access to S3, SNS and other service.

是否有更好的方法?这样安全吗?步骤3到步骤5有点麻烦。

Is there a better way to do this? Is this secure? Have a little trouble with steps 3 to 5.

推荐答案

由于您是从应用程序调用Lambda函数,因此需要添加权限为此,在IAM中。
您的流程看起来不错,只需确保您正在调用 GetOpenIdTokenForDeveloperIdentity 从您的Lambda函数。您可能要研究这个项目以供参考。

Since you are calling Lambda function from the app, you need to add permission for that in IAM. Your flow looks good, just make sure you are calling GetOpenIdTokenForDeveloperIdentity from your Lambda function. You might want to look into this project for references.

这篇关于使用iOS SDK Cognito Lambda和DynamoDB为AWS iOS创建用户/开发人员定义的登录名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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