[iOS15, SwiftUI, AWS Amplify]
I'm using a
SignInWithAppleButton(
.signIn,
onRequest: configure,
onCompletion: handle
)
.signInWithAppleButtonStyle(.white)
.frame(height: 44.0)
.clipShape(Capsule(style: .continuous)
)
to call a handle function, that calls this signIn function:
func signIn(with identityToken: String) {
guard
let plugin = try? Amplify.Auth.getPlugin(for: AWSCognitoAuthPlugin().key),
let authPlugin = plugin as? AWSCognitoAuthPlugin,
case .awsMobileClient(let client) = authPlugin.getEscapeHatch()
else {
return
}
client.federatedSignIn(
providerName: "signInWithApple",
token: identityToken) { state, error in
if let unwrappedError = error {
print("Error in federatedSignIn: \(unwrappedError)")
return
}
guard let unwrappedState = state else {
print("userState unexpectedly nil")
return
}
print("Successful federated sign in:", unwrappedState)
}
}
}
The console prints Successful federated sign in: signedIn, but when I check the User Pool in AWS Amplify Admin UI or AWS Cognito, it is empty.
AWS Admin UI:
AWS Cognito -> User Pools -> Federated Identities:
Any ideas what I may be doing wrong?

