내 IOS 응용 프로그램에서 다른 AWS 도구에 직접 액세스 할 수 있도록 다음 코드를 사용하십시오.AWS Cognito Identity 사용 포인트
AWSCognitoCredentialsProvider *credentialsProvider = [[DeveloperAuthenticationProvider alloc] initWithRegionType:AWSRegionUSEast1 identityPoolId:@"poolId"];
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:credentialsProvider];
AWSServiceManager.defaultServiceManager.defaultServiceConfiguration = configuration;
__block NSString *cognitoId = nil;
// Retrieve your Amazon Cognito ID
[[credentialsProvider getIdentityId] continueWithBlock:^id(AWSTask *task)
{
if (task.error)
{
NSLog(@"Error: %@", task.error);
}
else
{
// the task result will contain the identity id
cognitoId = task.result;
}
return nil;
}];
그런 다음 AWS Lambda를 API 게이트웨이와 함께 사용하여 사용자 ID를 얻습니다.
내가 이것을 설명하면 내 게이트웨이 기능이 여전히 작동합니다. 따라서 s3과 같은 게이트웨이 외부의 모든 항목에 직접 액세스하려고하면 실패합니다. 권리? 또한 게이트웨이를 사용하여 람다에 액세스하므로 https : //를 보낼 수 있습니다. 감사. – cdub
Cognito없이 게이트웨이에 액세스 할 수 있으면 전세계 누구에게나 액세스 할 수 있습니다. 당신은 기능이 활짝 열려 있습니다. 이제는 이것을 사용하여 S3의 자산을 웹에 제공하는 REST 엔드 포인트를 제공 할 수 있습니다. 그건 의미가 있습니다. 또한 iOS의 모든 원시 AWS API 호출이 AWS REST API 로의 https 호출로 변환된다는 점에 유의해야합니다. –
나는 원시 https : 호출을 인식하지 못했습니다. 인지식으로 내 사용자에게만 내 API를 만들려면 어떻게해야합니까? 감사, – cdub