| 1 | # Hosted Login Example |
| 2 | |
| 3 | This folder contains a small SwiftUI-oriented example of the v1 MVP API surface: |
| 4 | |
| 5 | - `SmbCloudWebAuth` |
| 6 | - `SmbCloudSession` |
| 7 | - `SmbCloudCredentialsManager` |
| 8 | - `SmbCloudUserInfoClient` |
| 9 | |
| 10 | ## Files |
| 11 | |
| 12 | - `Package.swift` — standalone example package manifest |
| 13 | - `Sources/HostedLoginExample/HostedLoginExampleApp.swift` — SwiftUI app entry point |
| 14 | - `Sources/HostedLoginExample/AuthenticationStore.swift` — minimal observable auth state container |
| 15 | - `Sources/HostedLoginExample/HostedLoginView.swift` — simple signed-in / signed-out SwiftUI view |
| 16 | |
| 17 | ## Configuration you must replace |
| 18 | |
| 19 | Before using the example, replace: |
| 20 | |
| 21 | - `YOUR_OIDC_CLIENT_ID` |
| 22 | - `hostedloginexample://auth/callback` |
| 23 | - Keychain service name |
| 24 | |
| 25 | ## Build locally |
| 26 | |
| 27 | ```bash |
| 28 | swift build --package-path Examples/HostedLoginExample |
| 29 | ``` |
| 30 | |
| 31 | ## Security note |
| 32 | |
| 33 | Use a public client ID only. |
| 34 | Do not embed an smbCloud Auth `app_secret` in a shipped Apple app. |