Tag: 亚马逊认知

Amazon Cognito iOS SDK V2使用Facebook和Google+提供者身份validation问题

我目前无法授权使用AWS iOS SDK V2的用户使用Facebook和Google+作为提供者。 我不确定是否在AWS开发者控制台上设置了我的设置,或者是否在代码中。 这是身份池的angular色策略: { "Version": "2012-10-17", "Statement": [{ "Action": [ "mobileanalytics:PutEvents", "cognito-sync:*" ], "Effect": "Allow", "Resource": ["*"] }] 我确实收到未经授权的Cognito ID,但是当我尝试使用Facebook或Google+提供者身份validation时,它不起作用。 一旦Facebooklogin返回,我可以成功地使用用户属性来提取个人资料图片,姓名和电子邮件地址。 然后,我从Facebook会话中获取令牌(是的,这是一个非常长的string),并在deviceID类中使用它: – (void)loginViewFetchedUserInfo:(FBLoginView *)loginView user:(id<FBGraphUser>)user { //Populate viewcontoller with Facebook data self.profilePictureView.profileID = user.id; NSRange range = [user.name rangeOfString:@" "]; self.firstName.text = [user.name substringToIndex:range.location]; self.lastName.text = [user.name substringFromIndex:range.location+1]; self.emailAddress.text = [user […]

在我的iOS应用程序中configurationAmazon Mobile Analytics和AWS Cognito引发了一些与IAM链接的exception

这是我得到的错误: AWSiOSSDKv2 [错误] AWSMobileAnalyticsDefaultDeliveryClient.m行:282 | – [AWSMobileAnalyticsDefaultDeliveryClient submitEvents:andUpdatePolicies:] | 无法成功将事件传递到服务器。 响应码:0。 错误信息: 错误域= com.amazonaws.AWSCognitoIdentityErrorDomain代码= 6 操作无法完成。 我有以下政策在IAM AuthRole: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "mobileanalytics:PutEvents", "cognito-sync:*" ], "Resource": [ "*" ] } ] } 还有一个Unauthangular色: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "mobileanalytics:PutEvents", "cognito-sync:*" ], "Resource": [ "*" […]

未经身份validation的用户在AWS Cognito上authentication用户

我的代码在这里: 代码转贴,因为我想问一个更直接的问题。 如何在未经身份validation的用户和身份validation之间切换? 我的未authentication似乎caching,我已经使用这些方法: [credentialsProvider clearCredentials]; [credentialsProvider clearKeychain]; 在我的API代码的其余部分之前,它仍然无法正常工作。 任何帮助表示赞赏 注意:我知道这是行不通的,因为在我切换configuration/凭证提供程序后,使用lambda进行调用,只有授权用户才能调用此方法。 编辑@ behrooziAWS回答: API代码: id<AWSCognitoIdentityProvider> identityProvider = [[DeveloperIdentityProviderClass alloc] initWithRegionType:AWSRegionUSEast1 identityId:nil identityPoolId:@"SOMEIDENTITYPOOLID" logins:@{@"MYIDENTITYPROVIDERNAME": @"MYUSERNAME"} providerName:@"MYIDENTITYPROVIDERNAME" ]; [credentialsProvider setIdentityProvider:identityProvider]; [credentialsProvider setLogins:@{@"MYIDENTITYPROVIDERNAME": @"MYUSERNAME"}]; [[credentialsProvider refresh] continueWithBlock:^id(BFTask *task){ [self testAuth]; return [BFTask taskWithResult:nil]; }]; 完整的错误:BusyTime [27043:7097936] AWSiOSSDKv2 [详细] AWSURLResponseSerialization.m行:87 | – [AWSJSONResponseSerializer responseObjectForResponse:originalRequest:currentRequest:data:error:] | 响应正文:[{“message”:“请求中包含的安全令牌无效。”}] 2015-10-20 08:51:17.280 BusyTime […]

在iOS上使用AWS Cognito控制AWS EC2访问(或不使用)

我有点难以理解如何使用IAMangular色来限制对Amazon EC2实例的访问。 我目前正在研究Cognito,我想知道它是否可以帮助我。 我想限制我的EC2实例(我的意思是联系那里的Django服务器)访问只有一个特定的人群,dynamicips。 所以IP限制不是一个选项。 如果用户通过Cognito进行身份validation并获得临时凭证,并因此假定具体的IAMangular色,我希望他能够从我的iOS应用程序中与该EC2-Django服务器通信。 如果对服务器的请求没有IAM,我希望Amazon自动阻止它。 这是可能的,或者我必须做那个服务器端?

认知 – 禁止访问身份

我试图了解亚马逊认知,并尝试通过Facebooklogin后S3文件夹的列表内容。 脸书login工作正常。 当我点击testingbutton(cmdTestS3Tapped)它会引发以下错误。 我将amazonClientManager.h,AmazonClientManager.m和Constants.h包含在amazon提供的例子中。 常数以belllow给出。 有谁能帮我解决这个问题吗? #define AWSAccountID @"MyAccountID" #define CognitoPoolID @"us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx" #define CognitoRoleAuth @"arn:aws:iam::MyAccountID:role/Cognito_iOSTestPoolAuth_DefaultRole" #define CognitoRoleUnauth @"arn:aws:iam::MyAccountID:role/Cognito_iOSTestPoolAuth_DefaultRole" 这是angular色 – Cognito_iOSTestPoolAuth_DefaultRole { "Version": "2012-10-17", "Statement": [{ "Action": [ "mobileanalytics:PutEvents", "cognito-sync:*" ], "Effect": "Allow", "Resource": [ "*" ], "Effect": "Allow", "Action": "s3:*", "Resource": "*" }] } 这是信任关系 { "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": […]

在不configurationAmazon Cognito的情况下使用Amazon Mobile Analytics

与竞争分析服务相比,亚马逊移动分析似乎需要更多的configuration和集成步骤。 例如,在Flurry Analytics中,设置非常简单: [Flurry startSession:@"<app-id>"]; [Flurry logEvent:@"<event-name>"]; // Optionally, set the userID [Flurry setUserID:@"userid"]; 我希望亚马逊移动分析中的等效物对于未经authentication的用户是这样的: [AWSLogger defaultLogger].logLevel = AWSLogLevelVerbose; AWSMobileAnalytics* analytics = [AWSMobileAnalytics mobileAnalyticsForAppId:@"<app-id>"]; id<AWSMobileAnalyticsEventClient> eventClient = analytics.eventClient; id<AWSMobileAnalyticsEvent> event = [eventClient createEventWithEventType:@"ScreenView"]; [eventClient recordEvent:event]; 但是,在运行该代码并将应用程序置于后台上传并发送事件后,不会发出错误或其他日志消息。 Amazon的快速入门指南和本教程( http://www.nickyap.info/mobile-analytics/ )都会指导您完成configurationAmazon Cognito的额外步骤,即使是跟踪未经身份validation的用户。 这反过来又需要额外的AWS权限来创build我的AWS账户不具有的用户angular色等。 有没有人尝试使用亚马逊移动分析,而不先configurationCognito? 或者这是一个绝对的要求?

AWS iOS SDK Cognito开发人员authentication(Swift)

我很难弄清楚如何将我的服务器(通过AWS)提供的开发人员凭证返回给示例身份提供者。 看来我需要在ExampleIdentityProvider类的refresh方法中同步执行此操作。 我正在使用AFNetworking发出请求,但它是一个asynchronousGET请求。 我怎样才能做到这一点我的IdentityProvider刷新方法同步? 以下是在Swift中: class ExampleIdentityProvider: AWSAbstractIdentityProvider { var newToken: String! override var token: String { get { return newToken } set { newToken = newValue } } override func getIdentityId() -> BFTask! { if self.identityId != nil { return BFTask(result: self.identityId) }else{ return BFTask(result: nil).continueWithBlock({ (task) -> AnyObject! in if self.identityId == nil […]

未授权执行sts:AssumeRoleWithWebIdentity AWS s3 Cognitoauthentication失败

我有一个简单的iOS应用程序上传到S3。 我试图在所有的周围,尽pipe理想情况下,我想做Facebook。 2个IAMangular色(使用向导创build)。 IAMauthentication策略(for unauthangular色): { "Version": "2012-10-17", "Statement": [{ "Action": [ "mobileanalytics:PutEvents", "cognito-sync:*" ], "Effect": "Allow", "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject" ], "Resource": "arn:aws:s3:::[mybucketname]/*" } ] } 我的constants.h文件(scrubbed): #define AWSID @"[12 digit num]" #define PoolID @"us-east-1:[long id number]" #define CRUnauth @"arn:aws:iam::[id num]:role/Cognito_Auth_DefaultRole" #define CRAuth @"arn:aws:iam::[id num]:role/Cognito_auth_DefaultRole" […]

iOS(Swift)应用程序中的AWS Cognito用户池

我试图在我的iOS(Swift)应用程序中实现新的AWS Cognito用户池,但是我正努力使login过程正常工作。 我基本上试图按照这里提供的例子。 这是我迄今为止: AppDelegate中: class AppDelegate: UIResponder, UIApplicationDelegate, AWSCognitoIdentityInteractiveAuthenticationDelegate { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { let serviceConfiguration = AWSServiceConfiguration(region: AWSRegionType.USEast1, credentialsProvider: nil) AWSServiceManager.defaultServiceManager().defaultServiceConfiguration = serviceConfiguration let configurationUserPool = AWSCognitoIdentityUserPoolConfiguration( clientId: "###", clientSecret: "#########", poolId: "###") AWSCognitoIdentityUserPool.registerCognitoIdentityUserPoolWithConfiguration(serviceConfiguration, userPoolConfiguration: configurationUserPool, forKey: "UserPool") self.userPool = AWSCognitoIdentityUserPool(forKey: "UserPool") self.userPool!.delegate = self return true […]

AMAZON AWS我如何订阅端点到SNS主题?

我正在使用Amazon SNS和Amazon Cognito服务在iOS应用程序中实施推送通知。 Cognito成功保存令牌,我的应用程序得到通知,一切运作良好,但有一件事情。 现在,在开发过程中,我需要手动将端点添加到SNS主题,以便所有订阅者都可以收到通知。 当我将更新推向App Store时,将会添加数千个令牌。 我正在研究亚马逊AWS文档,但是没有线索可以在没有额外努力的情况下实现。 我的问题:是否有可能自动订阅端点到一个只有亚马逊服务的主题?