1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
Hi,
the secret has been unveiled. To connect as an anonymous user to a cognito identity pool you need these few lines of code:
AmazonCognitoIdentity client=AmazonCognitoIdentityClientBuilder
.standard()
.withRegion(Regions.EU_CENTRAL_1)
.withCredentials(new AWSStaticCredentialsProvider(new AnonymousAWSCredentials()))
.build();
Map<String,String> logins = new HashMap<String,String>();
logins.put("arn:aws:iam::1234567890:saml-provider/my-saml-provider", "A base64 SAML response");
GetIdRequest request = new GetIdRequest()
.withIdentityPoolId("eu-central-1:7xxxxx-cxxx-xxxx-xxx-xxxxx")
.withLogins(logins);
GetIdResult result= client.getId(request);
In the logins map you have to put the arn of the SAML provider you created in IAM using the SAML Metadata.
Edited by: drdimitri on Dec 9, 2019 1:50 AM
Edited by: drdimitri on Dec 10, 2019 5:01 AM
답변함 4년 전
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 일 년 전
- AWS 공식업데이트됨 6달 전