Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Change Log

## [2.3.0] 2026-06-05

* [Pull #337](https://github.com/uber/uber-ios-sdk/pull/337) OIDC Nonce and OAuth State Support

## [2.2.1] 2026-05-13

* [Pull #332](https://github.com/uber/uber-ios-sdk/pull/335) Clear plist fields
* [Pull #335](https://github.com/uber/uber-ios-sdk/pull/335) Clear plist fields

## [2.2.0] 2026-05-05

Expand Down
6 changes: 6 additions & 0 deletions Sources/UberAuth/AuthProviding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public protocol AuthProviding {

func logout() -> Bool

/// Attempts to handle an incoming URL on the native path.
///
/// - Returns: `true` if the URL was claimed by this provider — meaning it matched the redirect
/// URI and an active auth flow was in progress. A `true` return indicates the URL was handled,
/// the outcome (success or failure) is delivered via the completion passed to `execute`.
/// Returns `false` if the URL does not belong to this provider.
func handle(response url: URL) -> Bool

var isLoggedIn: Bool { get }
Expand Down
10 changes: 8 additions & 2 deletions Sources/UberAuth/Authorize/AuthenticationSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ protocol AuthenticationSessioning {
init(anchor: ASPresentationAnchor,
callbackURLScheme: String,
url: URL,
pendingState: String?,
completion: @escaping AuthCompletion)

func start()
}

Expand All @@ -43,8 +44,9 @@ final class AuthenticationSession: AuthenticationSessioning {
private let presentationContextProvider: ASWebAuthenticationPresentationContextProviding?

init(anchor: ASPresentationAnchor = ASPresentationAnchor(),
callbackURLScheme: String,
callbackURLScheme: String,
url: URL,
pendingState: String? = nil,
completion: @escaping AuthCompletion) {
self.presentationContextProvider = AuthPresentationContextProvider(anchor: anchor)
self.authSession = ASWebAuthenticationSession(
Expand All @@ -57,6 +59,10 @@ final class AuthenticationSession: AuthenticationSessioning {
case (.none, _):
completion(.failure(UberAuthError.invalidAuthCode))
case (.some(let url), _):
if let pending = pendingState, State.value(from: url) != pending {
completion(.failure(.stateMismatch))
return
}
guard let code = Self.parse(url: url) else {
completion(.failure(Self.parseError(url: url)))
return
Expand Down
Loading