Invalid error type on programatic cancellation of authorization flow
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
OIDExternalUserAgentSession's cancel method writes in the documentation that on call, it will throw an OIDErrorCodeProgramCanceledAuthorizationFlow error, but in reality a OIDErrorCodeUserCanceledAuthorizationFlow error is thrown in the implementation.
To Reproduce
Steps to reproduce the behavior:
- Create an authorization flow
- Progtamatically cancel it
- Observe the thrown error
let request = OIDAuthorizationRequest(...
let currentAuthorizationFlow = OIDAuthState.authState(...) { authState, error in
XCTAssertEqual((error as NSError).code, OIDErrorCode.programCanceledAuthorizationFlow.rawValue)
}
currentAuthorizationFlow.cancel()
Expected behavior
Expect a OIDErrorCodeProgramCanceledAuthorizationFlow error when OIDExternalUserAgentSession's login is programmatically canceled.
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
Start with Source/AppAuthCore/OIDExternalUserAgentSession.h and Source/AppAuthCore/OIDAuthorizationService.m, following the documented cancellation error and the implementation linked in the issue. Reproduce the programmatic cancellation flow from the provided Swift example and verify that the resulting error matches the documented OIDErrorCodeProgramCanceledAuthorizationFlow behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c, swift
- Domain
- authentication, mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100