No `code` query parameter in the redirect url throws exception
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
In testing our project authentication implementation using the AppAuth-iOS package, we have noticed that a redirect url without an authentication code parameter throws and NSException, crashing the app. This behaviour feels incorrect as we can't gracefully handle the situation in an error scenario.
To Reproduce
Steps to reproduce the behavior:
- Go to demo implementation where the resource server has an option to return a redirect url with no
codequery parameter - Tap on option to return a redirect url with no
codequery parameter - See that app crashes
Expected behavior
We would expect that some kind of NSError would be returned to the authState callback which could then be handled.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
- Device: [ e.g. iPhone SE (2nd Generation ]
- OS: [ iOS 17.2 ]
Additional context
Add any other context about the problem here.
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 OIDAuthorizationResponse.m at the linked code location and reproduce the demo flow that returns a redirect URL without a code query parameter. Trace how that response reaches the authState callback and inspect existing error handling. Done means the missing-code case returns an NSError to the callback instead of throwing an NSException or crashing the app.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c
- Domain
- authentication, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100