Home IOS Development swift – 1Password Passage Auth For iOS – Unclear Error Messaging

swift – 1Password Passage Auth For iOS – Unclear Error Messaging

0
swift – 1Password Passage Auth For iOS – Unclear Error Messaging

[ad_1]

I obtain this errors from the under implementation:

error: The operation couldn’t be accomplished. (Passage.PassageASAuthorizationError error 5.)
ASAuthorizationController credential request failed with error: Error Area=com.apple.AuthenticationServices.AuthorizationError Code=1004 “(null)”

I am working via the iOS-specific implementation of Passage Auth. Utilizing the instance code right here:

https://docs.passage.id/cell/ios/get-started#register-new-user

I’ve created a easy Registration as a begin, however having a extremely onerous time understanding the failure factors or what could also be configured flawed when passing an Electronic mail. This is my SwiftUI:

        VStack {
            TextField("Electronic mail", textual content: $identifier)
                .textFieldStyle(.roundedBorder)
            Button("Register", motion: registerNewUser)
//            Button("Log In", motion: loginWithPasskey)
            
        }
        .alert("Success", isPresented: $isShowingSuccessAlert) {} message: {
            Textual content("Auth token: (authToken)")
        }
        .alert("Failure", isPresented: $isShowingFailureAlert) {}
        .padding()
    }

    func registerNewUser() {
        Job {
            do {
                let outcome = strive await passage.register(identifier: identifier)
                if let token = outcome.authResult?.authToken {
                    print(token)
                } else if let authFallbackResult = outcome.authFallbackResult {
                    print(authFallbackResult)
                }
            } catch {
                print("error: (error.localizedDescription)")
            }
        }
    }

Adopted all of the setup steps from Passage docs. Looks like this framework continues to be new sufficient that few people have posted assets or helpers associated to implementing this framework for native iOS.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here