Skip to content

Support https redirect URIs in browser sign-in - #252

Merged
AlexNachbaur merged 8 commits into
masterfrom
browser-universal-link
Sep 23, 2025
Merged

Support https redirect URIs in browser sign-in#252
AlexNachbaur merged 8 commits into
masterfrom
browser-universal-link

Conversation

@AlexNachbaur

@AlexNachbaur AlexNachbaur commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

Note

These changes require that the server resource is configured to support associated domains for this application.

Without associated domain configuration set, a developer would receive the following error response:

Application with identifier com.example.okta-sample.WebSignIn is not associated with domain example.com. Using HTTPS callbacks requires Associated Domains using the webcredentials service type for example.com."

> [!WARNING]
> These changes require that the server resource is configured to support associated domains for this application.
@AlexNachbaur
AlexNachbaur marked this pull request as ready for review September 16, 2025 18:44
Copilot AI review requested due to automatic review settings September 16, 2025 18:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for HTTPS redirect URIs in browser sign-in by leveraging the newer ASWebAuthenticationSession API available on iOS 17.4+. The changes enhance the authentication flow to handle both custom scheme and HTTPS redirect URIs while maintaining backward compatibility.

  • Adds a new createSession method that selects the appropriate ASWebAuthenticationSession initializer based on platform availability and redirect URI scheme
  • Updates error handling to include more detailed cancellation reasons
  • Improves sample app UI state management during sign-in flow

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Sources/BrowserSignin/Providers/AuthenticationServicesProvider.swift Core implementation for HTTPS redirect URI support with platform availability checks
Sources/BrowserSignin/BrowserSignin.swift Updated documentation and error case to support cancellation reasons
Sources/BrowserSignin/Internal/BrowserSigninError+Extensions.swift Enhanced error handling for user cancellation with optional reason parameter
Sources/BrowserSignin/Resources/en.lproj/BrowserSignin.strings Added new localized string for detailed cancellation error messages
Samples/WebSignIn/WebSignIn (macOS)/WebSignIn/SignIn/SignInView.swift Improved state management and UI control during sign-in process
Samples/WebSignIn/WebSignIn (iOS)/WebSignIn/SignInViewController.swift Added button state management to prevent multiple concurrent sign-in attempts

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

options.contains(.ephemeralSession)
}
set {
options.insert(.ephemeralSession)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a correct logic of property?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦🏼‍♀️ Yes, you're absolutely right. I have this changed locally, but it didn't get pushed up to the PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IldarAbdullin-okta I included tests as well in my update, since I feel sheepish for missing it 😆

@IldarAbdullin-okta IldarAbdullin-okta left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@AlexNachbaur
AlexNachbaur merged commit 1c4be09 into master Sep 23, 2025
22 checks passed
@AlexNachbaur
AlexNachbaur deleted the browser-universal-link branch September 23, 2025 22:13
AlexNachbaur added a commit that referenced this pull request Nov 19, 2025
* Support https redirect URIs in browser sign-in

* Improve browser sign in error messaging

* Expose the browser providers and their factory for extension and testing

> [!WARNING]
> These changes require that the server resource is configured to support associated domains for this application.
AlexNachbaur added a commit that referenced this pull request Nov 21, 2025
* Support https redirect URIs in browser sign-in (#252)
* Improve browser sign in error messaging
* Fix import statements for other platforms (#256)
* Fix problems with BrowserSignin on tvOS (#259)
* Bump version numbers and include additional docs
* Expose the browser providers and their factory for extension and testing

> [!WARNING]
> These changes require that the server resource is configured to support associated domains for this application.
AlexNachbaur added a commit that referenced this pull request Dec 10, 2025
* Support https redirect URIs in browser sign-in (#252)
* Improve browser sign in error messaging
* Fix import statements for other platforms (#256)
* Fix problems with BrowserSignin on tvOS (#259)
* Bump version numbers and include additional docs
* Expose the browser providers and their factory for extension and testing

> [!WARNING]
> These changes require that the server resource is configured to support associated domains for this application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants