You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: EXAMPLES.md
+99-7Lines changed: 99 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -367,6 +367,28 @@ The Credentials Manager utility allows you to securely store and retrieve the us
367
367
let credentialsManager =CredentialsManager(authentication: Auth0.authentication())
368
368
```
369
369
370
+
> [!NOTE]
371
+
> **Swift 6 Concurrency Support**: The Credentials Manager conforms to `Sendable` and can be safely used across concurrency contexts, including within actors.
372
+
>
373
+
> ```swift
374
+
>// Example: Using CredentialsManager in an Actor (Swift 6)
> The Credentials Manager is not thread-safe, except for the following methods:
372
394
>
@@ -2965,7 +2987,11 @@ Check the [API documentation](https://auth0.github.io/Auth0.swift/documentation/
2965
2987
2966
2988
## Logging
2967
2989
2968
-
Auth0.swift can print HTTP requests and responses for debugging purposes. Enable it by calling the following method in either `WebAuth`, `Authentication` or `Users`:
2990
+
Auth0.swift provides comprehensive logging capabilities for debugging HTTP requests and responses. The logging system is built on Apple's [Unified Logging](https://developer.apple.com/documentation/os/logging) (`OSLog`) for better performance and integration with system diagnostic tools.
2991
+
2992
+
### Enable Logging
2993
+
2994
+
Enable logging by calling the `logging(enabled:)` method on `WebAuth`, `Authentication`, or `Users`:
2969
2995
2970
2996
```swift
2971
2997
Auth0
@@ -2974,32 +3000,98 @@ Auth0
2974
3000
// ...
2975
3001
```
2976
3002
3003
+
```swift
3004
+
Auth0
3005
+
.authentication()
3006
+
.logging(enabled: true)
3007
+
// ...
3008
+
```
3009
+
3010
+
```swift
3011
+
Auth0
3012
+
.users(token: credentials.accessToken)
3013
+
.logging(enabled: true)
3014
+
// ...
3015
+
```
3016
+
2977
3017
> [!CAUTION]
2978
-
> Set this flag only when **DEBUGGING** to avoid leaking user's credentials in the device log.
3018
+
> Enable logging **only when debugging** to avoid performance impacts and potential security concerns in production builds.
2979
3019
2980
-
With a successful authentication you should see something similar to the following:
3020
+
### Automatic Token Redaction
3021
+
3022
+
**Security First**: Auth0.swift automatically redacts sensitive information from logs to protect user credentials. The following fields are redacted when logging HTTP responses:
3023
+
3024
+
-`access_token`
3025
+
-`refresh_token`
3026
+
-`id_token`
3027
+
3028
+
Redacted tokens appear as `"redacted"` in the logs, ensuring sensitive data never appears in plain text.
3029
+
3030
+
### Logging Output
3031
+
3032
+
With logging enabled, you'll see detailed HTTP request and response information. Here's an example of what a successful authentication flow looks like:
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -347,7 +347,7 @@ Check the [FAQ](FAQ.md) for more information about the alert box that pops up **
347
347
348
348
Auth0.swift uses Apple's Unified Logging (OSLog) to help you troubleshoot issues during development. Enable detailed HTTP logging to see network requests, responses, and errors.
349
349
350
-
### Enable Logging (NetworK Tracing based logs)
350
+
### Enable Logging (Network Tracing based logs)
351
351
352
352
To enable detailed HTTP request and response tracing during development:
0 commit comments