Describe the bug
Amplify.Auth.signInWithWebUI() crashes app due to scheme validation. The app is not accepting a URL scheme with "://" in it. This is not allowing a user to sign in via WebUI.
Xcode produces the following response:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:
'The provided scheme is not valid. A scheme should not include special characters such as ":" or "/".'
AWS Amplify documentation does not mention a step to avoid this behavior.
To Reproduce
Steps to reproduce the behavior:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>myapp</string>
</array>
</dict>
</array>
func signInWithWebUI() {
Amplify.Auth.signInWithWebUI(presentationAnchor: self.view.window!) { result in
switch result {
case .success:
print("Sign in succeeded")
case .failure(let error):
print("Sign in failed \(error)")
}
}
}
Expected behavior
WebUI window to opens up to allow for user sign in.
Screenshots
amplifyconfiguration.json

Environment:
Device Information:
@ncrews35
We think we've found the cause of the error message, but I don't see that it crashes the app. In my testing, the app continues with the HostedUI flow and a user is able to sign in successfully.
However, that behavior may be because I'm running in a debugger; additional optimizations may apply in release mode that change that behavior, and in any case, we don't want to invoke our ASWebAuthenticationSession with incorrect data. We'll get this fix and update this ticket when we have more info.
Fix is merged into the SDK. We'll need to release the SDK, then do an Amplify release that updates dependencies in Podfile.lock we ship. However, after we do the SDK release, a pod update in your app project should update Amplify's dependencies to the latest, assuming I haven't misremembered something about CocoaPods dependency resolution.
@ncrews35
The AWS Mobile SDK for iOS 2.23.1 release is complete.
You should be able to do a pod update on your project and have it update to the latest dependencies.
@palpatim
Everything is working great. Thanks for the help!
Most helpful comment
Fix is merged into the SDK. We'll need to release the SDK, then do an Amplify release that updates dependencies in Podfile.lock we ship. However, after we do the SDK release, a
pod updatein your app project should update Amplify's dependencies to the latest, assuming I haven't misremembered something about CocoaPods dependency resolution.