Skip to content

Commit 76bf2d8

Browse files
docs: swift quickstart improvements as guided by evals flywheel to improve Agentic experience (#1386)
* docs(ios-swift): add CredentialsManager callout in Step 5 * adding warning for not using raw values and use plist based approach
1 parent 953962d commit 76bf2d8

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

main/docs/quickstart/native/ios-swift.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ Your AI assistant will automatically create your Auth0 application, fetch creden
163163
</Step>
164164

165165
<Step title="Create the Authentication Service" stepNumber={5}>
166-
Create `AuthenticationService.swift`:
166+
Create `AuthenticationService.swift` to handle login, logout, and token storage.
167+
168+
<Info>
169+
**Use `CredentialsManager` for token storage.** The `CredentialsManager` class securely stores credentials in the Keychain and automatically refreshes expired access tokens. Always use it — do not store tokens in memory, `UserDefaults`, or `localStorage`.
170+
</Info>
167171

168172
1. Right-click your project → **New File...****Swift File**
169173
2. Name it `AuthenticationService`
@@ -370,6 +374,10 @@ This is **required** for certain features to work properly:
370374
<Accordion title="Advanced Integration">
371375
### Programmatic Configuration
372376

377+
<Warning>
378+
Never hardcode `clientId` or `domain` values directly in Swift source files — they will be committed to version control. Read them from environment variables or a build-time configuration file at runtime. For most apps, prefer `Auth0.plist` (the default approach in this quickstart).
379+
</Warning>
380+
373381
Instead of using `Auth0.plist`, you can pass credentials directly in your code. This is useful when credentials need to be dynamic or environment-specific (e.g., different Auth0 tenants for dev/staging/production).
374382

375383
**Replace `Auth0.webAuth()` calls with `Auth0.webAuth(clientId:domain:)`:**

0 commit comments

Comments
 (0)