Skip to content

Commit 850d287

Browse files
committed
Remove unnecessary code
1 parent 5ee4ae9 commit 850d287

File tree

1 file changed

+1
-18
lines changed
  • swift/example_code/identity-resolvers/cognito-resolver/Sources

1 file changed

+1
-18
lines changed

swift/example_code/identity-resolvers/cognito-resolver/Sources/Example.swift

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -125,28 +125,11 @@ class Example {
125125

126126
// snippet-start:[swift.identity.cognito.resolve]
127127
// Create a Cognito credential resolver that uses the Cognito Identity
128-
// Pool created above.
128+
// Pool.
129129
let cognitoCredentialResolver = try CognitoAWSCredentialIdentityResolver(
130130
identityPoolId: identityPoolID,
131131
identityPoolRegion: region
132132
)
133-
134-
// Create an AWS STS client that uses the new Cognito credential
135-
// resolver to do credential identity resolution.
136-
let cognitoSTSConfig = try await STSClient.STSClientConfiguration(
137-
awsCredentialIdentityResolver: cognitoCredentialResolver,
138-
region: "us-east-1"
139-
)
140-
let cognitoSTSClient = STSClient(config: cognitoSTSConfig)
141-
142-
let output = try await cognitoSTSClient.getCallerIdentity(
143-
input: GetCallerIdentityInput()
144-
)
145-
146-
print("Authenticated with AWS using Cognito!")
147-
print(" ARN: \(output.arn ?? "<unknown>")")
148-
print(" Account ID: \(output.account ?? "<unknown>")")
149-
print(" User ID: \(output.userId ?? "<unknown>")")
150133
// snippet-end:[swift.identity.cognito.resolve]
151134

152135
//======================================================================

0 commit comments

Comments
 (0)