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: OktaAuthFoundation.podspec
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
Pod::Spec.newdo |s|
2
2
s.name="OktaAuthFoundation"
3
3
s.module_name="AuthFoundation"
4
-
s.version="2.1.4"
4
+
s.version="2.1.5"
5
5
s.summary="Okta Authentication Foundation"
6
6
s.description=<<-DESC
7
7
Provides the foundation and common features used to authenticate users, managing the lifecycle and storage of tokens and credentials, and provide a base for other Okta SDKs to build upon.
Copy file name to clipboardExpand all lines: OktaClient.podspec
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
Pod::Spec.newdo |s|
2
2
s.name="OktaClient"
3
-
s.version="2.1.4"
3
+
s.version="2.1.5"
4
4
s.summary="Secure client authentication, request authorization, and user management capabilities for Swift."
5
5
s.description=<<-DESC
6
6
Provides a modularized set of libraries that provide the building blocks and convenience features used to authenticate users, manage the lifecycle and storage of tokens and user credentials, and provide a base for other libraries and applications to build upon.
Copy file name to clipboardExpand all lines: README.md
+49-3Lines changed: 49 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,6 +182,53 @@ pod 'OktaIdxAuth'
182
182
183
183
## Usage Guide
184
184
185
+
Every authentication flow follows the same two-method pattern defined by the
186
+
`AuthenticationFlow` protocol:
187
+
188
+
1.**`start()`** — initiates the flow (builds an authorize URL, sends
189
+
credentials, etc.) and returns either a token or an intermediate value
190
+
needed by the next step.
191
+
2.**`resume()`**_(optional)_ — completes a multi-step flow by exchanging the
192
+
intermediate value for tokens (e.g., trading an authorization code for an
193
+
access token, polling for device authorization, etc.).
194
+
195
+
Single-step flows such as Resource Owner, JWT Bearer, and Token Exchange
196
+
resolve entirely in `start()`. Multi-step flows like Authorization Code and
197
+
Device Authorization require a subsequent call to `resume()`.
198
+
199
+
All flows accept an optional **authentication context** that carries
200
+
cross-cutting parameters such as `audience`, `resource`, `nonce`, and
201
+
`maxAge`. See [Authentication Context](#authentication-context) below for
202
+
details.
203
+
204
+
### Authentication Context
205
+
206
+
All authentication flows accept an optional `context` parameter that carries cross-cutting authentication properties. Some flows require a specific context type (e.g., `AuthorizationCodeFlow.Context` for the Authorization Code flow), while simpler flows use `StandardAuthenticationContext`:
207
+
208
+
```swift
209
+
let flow =ResourceOwnerFlow(issuerURL: URL(string: "https://example.okta.com")!,
210
+
clientId: "abc123client",
211
+
scope: "openid offline_access email profile")
212
+
let token =tryawait flow.start(
213
+
username: "jane@example.com",
214
+
password: "secretPassword",
215
+
context: .init(
216
+
audience: "api://my-resource-server",
217
+
resource: "https://api.example.com/v1", // or an array of URIs
218
+
maxAge: 3600,
219
+
nonce: "custom-nonce"
220
+
)))
221
+
```
222
+
223
+
| Property | Type | Description |
224
+
| --- | --- | --- |
225
+
|`nonce`|`String?`| Custom nonce for ID token replay protection. |
226
+
|`maxAge`|`TimeInterval?`| Maximum authentication age (seconds). |
227
+
|`audience`|`String?`| Target resource server ([RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707)). Sent in the token request. |
228
+
|`resource`|`[String]?`| Target resource URI(s) ([RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707)). Sent in the token request. Accepts a string literal or an array of strings. |
229
+
|`acrValues`|`[String]?`| Requested Authentication Context Class Reference values. |
230
+
|`additionalParameters`|`[String: String]?`| Extra parameters forwarded to the token request. |
231
+
185
232
### Web Authentication using OIDC
186
233
187
234
The simplest way to integrate authentication in your app is with OIDC through a web browser, using the Authorization Code Flow grant.
@@ -263,8 +310,7 @@ When using the `device_sso` scope, your application can receive a "device secret
For more information, see the [OktaIdxAuth API documentation][oktaidxauth-docs].
320
-
366
+
321
367
## Storing and using tokens
322
368
323
369
Once your user has authenticated and you have a `Token` object, your application can store and use those credentials. The most direct approach is to use the `Credential.store(_:tags:security:)` function.
0 commit comments