openid / openid/AppAuth-iOS

Present ExternalUserAgent without passing UIViewController for iOS

Open
#338 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement in-scope
Dominant language
Objective-C
Stars
2k
Forks
867
Avg merge
4d 48m
Merged PRs (30d)
1

Description

Hi @WilliamDenniss

@iainmcgin and I work in the same technology group and he encourages me to contribute.

While I was working on integrating our iOS SDK with AppAuth, I struggled asking our developers to pass UIViewController in order to sign in.

I understand that devices below iOS 11 require a UIViewController to present SafariViewController, however, an API that depends on UI code seems to violate the concept of clean architecture. I ended up minimizing the problem by marking iOS version with attribute

@available(iOS, deprecated: 11, message: "use signIn()")
public func signIn(from viewController: UIViewController) {}

@available(iOS 11, *)
public func signIn() {
  signIn(from: UIViewController(nibName: nil, bundle: nil))
}

This solve my immediate problem because the apps we're going to support will soon stop supporting iOS 10. But this also makes me wonder if SFAuthenticationSession on iOS 11 and ASWebAuthenticationSession on iOS 12 simply just present their web views on the top most view controller, maybe it is not such a bad idea to do the same for iOS 9 and 10 for the sake of consistency and cleanness.

Please let me know how you think.

Thanks

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 by reviewing the existing signIn(from:) and signIn() entry points described in the issue, along with the iOS 9–12 authentication presentation behavior. Done would require a maintainer-approved API design for presenting authentication without a caller-supplied UIViewController and agreement on the supported iOS versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c, swift
Domain
api, authentication, mobile-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.