Skip to content

Allow client to choose the request environment#332

Merged
mohssenfathi merged 2 commits intouber:developfrom
luizgustavo09:feature/develop/customizable-enviroments
May 4, 2026
Merged

Allow client to choose the request environment#332
mohssenfathi merged 2 commits intouber:developfrom
luizgustavo09:feature/develop/customizable-enviroments

Conversation

@luizgustavo09
Copy link
Copy Markdown
Contributor

@luizgustavo09 luizgustavo09 commented Apr 29, 2026

Add support for customizable auth environments (production / sandbox)

Summary

A 3P developer requested the ability to target different Uber auth environments from the iOS SDK.

Previously the SDK hardcoded https://auth.uber.com across all auth flows with no way for 3Ps to redirect to sandbox.

  • Adds a new UberEnvironment enum to UberCore with .production and .sandbox cases, each mapping to its base URL (auth.uber.com / sandbox-login.uber.com)
  • Threads environment through AuthorizationCodeAuthProvider's public initializer (defaults to .production — fully backwards-compatible)
  • Example app updated with an Environment picker so the flow can be tested end-to-end against sandbox

Usage

// Production (default — no change for existing integrations)
let provider = AuthorizationCodeAuthProvider()

// Sandbox
let provider = AuthorizationCodeAuthProvider(environment: .sandbox)

Test plan

  • New unit tests verify production URLs contain auth.uber.com and sandbox URLs contain sandbox-login.uber.com for both in-app and native login flows
  • All existing tests pass
  • Manually tested in the example app using the new Environment picker
Screen.Recording.2026-04-30.at.14.23.59.mov
Screen.Recording.2026-04-30.at.14.25.42.mov

if shouldForceLogin { prompt.insert(.login) }
if shouldForceConsent { prompt.insert(.consent) }

let uberEnvironment: UberEnvironment = environment == .sandbox ? .sandbox : .production
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we just pass this through to authProvider?

@mohssenfathi mohssenfathi merged commit 85beae2 into uber:develop May 4, 2026
2 checks passed
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.

2 participants