Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error. showing error: login(description: "Authentication Failed") #98

Open
kushaldexati opened this issue Feb 7, 2022 · 3 comments
Open

Comments

@kushaldexati
Copy link

when I try to log in it is showing
error: login(description: "Authentication Failed")

currently trying to login with iCloud

@cyracle
Copy link

cyracle commented Mar 12, 2022

This just started happening to me too. It was working fine in January, and little if anything changed, and now this error on this line:
let postal = Postal(configuration: .gmail(login: login, password: .accessToken(accessToken)))

Able to get accessToken just fine.
Tried different IMAP account. Tried previous working commits. Tried different Google app registration. Tried different Apple cert. Nothing worked.

@cyracle
Copy link

cyracle commented Apr 2, 2022

In my case, the root cause was something changing on my google cert side, and the gmail api scope wasn't part of that google cert anymore. Once the gmail api scope was added back, it worked. Adding the scope via google console web UI never made a difference. Only worked through their api client for changing scope:


func ensureGoogleScope(user: GIDGoogleUser?) {
        let gmailScope = "https://mail.google.com/"
        let grantedScopes = user?.grantedScopes
        if grantedScopes == nil || !grantedScopes!.contains(gmailScope) {
          // Request additional Drive scope.
          let additionalScopes = [gmailScope]
          GIDSignIn.sharedInstance.addScopes(additionalScopes, presenting:  getRootViewController()) { user, error in
              guard error == nil else { return }
              guard let user = user else { return }

            // Check if the user granted access to the scopes you requested.
            print("granted scopes: \(String(describing: user.grantedScopes))")
          }

        }
      }

@cyracle
Copy link

cyracle commented Apr 2, 2022

Suggestion for Postal:
Show the complete error text from google. That would have indicated the exact cause of "Authentication Failed", such as not having the correct scope, or whatever the issue is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants