Error Domain=org.openid.appauth.general Code=-15 "Nonce mismatch"
Nobody has claimed this yet.
- Dominant language
- Objective-C
- Stars
- 2k
- Forks
- 867
- Avg merge
- 4d 48m
- Merged PRs (30d)
- 1
Description
Describe the bug
Error Domain=org.openid.appauth.general Code=-15 "Nonce mismatch".
Xcode 10
Swift 4.2
AppAuth version 0.95.0
To Reproduce
Steps to reproduce the behavior:
- Singing button clicked in the app
- Browser opened
- enter login credentials
- Redirected to app and See error
Expected behavior
Should open the app and get in the app
Smartphone (please complete the following information):
- Device: iPhone X
- iOS: iOS 12
- Browser: Safari
Additional context
`let currentAuthorizationFlow = OIDAuthState.authState(byPresenting: request, presenting: self, callback: { [weak self] (authState, error) in
guard let strongSelf = self else {
return
}
if let authState = authState, let authCode = authState.lastTokenResponse?.idToken {
if strongSelf.mainViewModel.updateSessionData(accessToken: authCode, authState: authState) {
strongSelf.mainViewModel.loginAction.apply(()).start()
} else {
strongSelf.loginActivityView.isHidden = true
}
}
else {
print("Authorization error: \(String(describing: error?.localizedDescription))")
if strongSelf.mainViewModel.shouldDefaultToLoyalty {
let loyaltyPermission = PermissionHandler.loyaltyPermission
for (index, permission) in strongSelf.mainViewModel.stateStorage.userPermissions.enumerated() {
if permission.permissionType == .loyalty {
strongSelf.mainViewModel.stateStorage.userPermissions[index] = loyaltyPermission
}
}
}
//Do not show alert in case of general error(org.openid.appauth.general)
if let generalError = error as NSError?, generalError.code == -4 {
return
}
let confirmAction = UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: {[weak self] (_) in
self?.dismiss(animated: true, completion: nil)
})
//Handle View Hierarchy - Add delay to alert on clicking done button from SafariViewController
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
AlertView.show(alertContents: AlertView.Content(title: NSLocalizedString("Error", comment: ""), message: NSLocalizedString("Unknown Error", comment: ""), buttonTitle: "", actions: [confirmAction]))
}
}
})`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The report names no source file or test. Start by reproducing the flow through OIDAuthState.authState(byPresenting:presenting:callback:) with AppAuth 0.95.0 on iOS 12, then trace where the nonce-mismatch error is produced; done means identifying the cause and providing a verified resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, objective-c, swift
- Domain
- authentication, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100