openid / openid/AppAuth-iOS

Invalid error type on programatic cancellation of authorization flow

Open
#628 1 comment 0 reactions 0 assignees View on GitHub

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:

  1. Create an authorization flow
  2. Progtamatically cancel it
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.