-
Notifications
You must be signed in to change notification settings - Fork 226
Closed
Labels
authIssues related to the Auth categoryIssues related to the Auth categorybugSomething isn't workingSomething isn't workingpending-releaseCode has been merged but pending release Code has been merged but pending releaseCode has been merged but pending release Code has been merged but pending release
Description
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:
- Setup locally by following AWS Amplify iOS authentication documentation :
https://docs.amplify.aws/lib/auth/getting-started/q/platform/ios - Push Amplify to backend
- Add URL scheme to info.plist
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>myapp</string>
</array>
</dict>
</array>
- Initialize Amplify plugins in AppDelegate.swift
- Call the below method
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:
- Amplify Framework Version: [1.6.1]
- Dependency Manager: Cocoapods
- Swift Version: 5
- CLI Version: [4.44.2]
Device Information:
- Device: iPhone XR
- iOS Version: 14.5
Metadata
Metadata
Assignees
Labels
authIssues related to the Auth categoryIssues related to the Auth categorybugSomething isn't workingSomething isn't workingpending-releaseCode has been merged but pending release Code has been merged but pending releaseCode has been merged but pending release Code has been merged but pending release