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: packages/davinci-client/src/lib/fido/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@
4
4
5
5
The `fido` API provides an interface for registering and authenticating with the WebAuthn API and transforming data to and from DaVinci. These methods transform options from DaVinci into WebAuthn compatible options, then call `navigator.credentials.create` or `navigator.credentials.get`, and finally transform the output of the WebAuthn API into a valid payload to send back to DaVinci.
6
6
7
+
**Note**: To use this module, browser support is required for `navigator.credentials.create` and `navigator.credentials.get`
8
+
7
9
## Installation and Initialization
8
10
9
11
The `fido` module is exported as a member of the `@forgerock/davinci-client` package and is intended to be used alongside the `davinciClient` to progress through a flow. To install the necessary dependencies, run:
* @param {GetProfileDevices} query - The query used to get profile devices
295
299
* @returns {Promise<ProfileDevice[] | { error: unknown }>} - A promise that resolves to the response data or an error object if the response is not valid.
Copy file name to clipboardExpand all lines: packages/oidc-client/README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
-
# oidc-client
1
+
# OIDC Client
2
2
3
-
A generic OpenID Connect (OIDC) client library for JavaScript and TypeScript, designed to work with any OIDC-compliant identity provider.
3
+
A generic OpenID Connect (OIDC) client library for JavaScript and TypeScript, designed to work with PingOne platforms.
4
+
5
+
The oidc module follows the [OIDC](https://openid.net/specs/openid-connect-core-1_0.html) specification and provides a simple and easy-to-use API to interact with the OIDC server. It allows you to authenticate, retrieve the access token, revoke the token, and sign out from the OIDC server.
@@ -70,10 +70,10 @@ if (step.getCallbacksOfType('PingOneProtectInitializeCallback')) {
70
70
71
71
#### Data collection
72
72
73
-
You then call the `FRAuth.next` method after initialization to move the user forward in the journey.
73
+
You then call the `next` method after initialization to move the user forward in the journey.
74
74
75
75
```js
76
-
FRAuth.next(step);
76
+
journeyClient.next(step);
77
77
```
78
78
79
79
At some point in the journey, and as late as possible in order to collect as much data as you can, you will come across the `PingOneProtectEvaluationCallback`. This is when you call the `getData` method to package what's been collected for the server to evaluate.
@@ -92,12 +92,12 @@ Now that we have the data, set it on the callback in order to send it to the ser
92
92
```js
93
93
callback.setData(data);
94
94
95
-
FRAuth.next(step);
95
+
journeyClient.next(step);
96
96
```
97
97
98
98
### Error Handling
99
99
100
-
The Protect API methods will return an error object if they fail. When you encounter an error during initialization or evaluation, set the error message on the callback using the `setClientError` method. Setting the message on the callback is how it gets sent to the server on the `FRAuth.next` method call.
100
+
The Protect API methods will return an error object if they fail. When you encounter an error during initialization or evaluation, set the error message on the callback using the `setClientError` method. Setting the message on the callback is how it gets sent to the server on the `next` method call.
101
101
102
102
```js
103
103
if (step.getCallbacksOfType('PingOneProtectInitializeCallback')) {
@@ -7,22 +7,20 @@ The IFrame Manager Effect provides a mechanism to perform operations within a hi
7
7
The core functionality involves:
8
8
9
9
1. Creating a hidden `<iframe>` dynamically.
10
-
1. Navigating the iframe to a specified URL.
11
-
1. Monitoring the iframe's `load` events to detect navigation changes.
12
-
1. Once a navigation occurs back to the **same origin** as the parent application, parsing the query parameters from the iframe's URL.
13
-
1. Resolving or rejecting a Promise based on the presence of predefined "success" or "error" query parameters.
14
-
1. Handling timeouts and potential errors (like cross-origin access restrictions).
10
+
2. Navigating the iframe to a specified URL.
11
+
3. Monitoring the iframe's `load` events to detect navigation changes.
12
+
4. Once a navigation occurs back to the **same origin** as the parent application, parsing the query parameters from the iframe's URL.
13
+
5. Resolving or rejecting a Promise based on the presence of predefined "success" or "error" query parameters.
14
+
6. Handling timeouts and potential errors (like cross-origin access restrictions).
15
15
16
16
**Key Constraint: Same-Origin Policy**
17
17
18
18
This utility fundamentally relies on the browser's **Same-Origin Policy**. The final URL that the iframe is redirected to (the one containing the expected `successParams` or `errorParams`) **MUST** be on the exact same origin (protocol, hostname, and port) as the main application window. Attempting to access the location (`contentWindow.location`) of an iframe pointing to a different origin will be blocked by the browser, causing the operation to fail.
19
19
20
20
## Installation
21
21
22
-
This effect is typically part of a larger SDK. Assume it's imported or available within your project structure like so (adjust path as necessary):
23
-
24
22
```typescript
25
-
importiFrameManagerfrom'./path/to/iframe-manager.effects'; // Adjust path as needed
@@ -40,19 +38,16 @@ This is the main factory function that initializes the effect.
40
38
This method creates a hidden iframe, initiates navigation, and waits for a redirect back to the application's origin containing specific query parameters.
41
39
42
40
-**`options`**: `GetParamsFromIFrameOptions` - An object containing configuration for the iframe request.
43
-
44
41
-**`url: string`**: The initial URL to load within the hidden iframe. This URL is expected to eventually redirect back to the application's origin.
45
42
-**`timeout: number`**: The maximum time in milliseconds to wait for the entire operation to complete successfully (i.e., for a redirect containing success or error parameters). If the timeout is reached before completion, the promise rejects.
46
-
47
43
***`successParams: string[]`**: An array of query parameter _keys_. If the final redirect URL (on the same origin) contains **at least one** of these keys in its query string, the promise will **resolve**.
48
-
***`errorParams: string[]`**: An array of query parameter _keys_. If the final redirect URL (on the same origin) contains **any** of these keys in its query string, the promise will **reject**. Error parameters are checked _before_ success parameters.
44
+
***`errorParams: string[]`**: An array of query parameter _keys_. If the final redirect URL (on the same origin) contains **any** of these keys in its query string, the promise will **resolve** with all parsed parameters (including the error parameters). The caller must check the returned parameters for error keys. Error parameters are checked _before_ success parameters.
49
45
-_Note:_ Both `successParams` and `errorParams` must be provided and contain at least one key.
50
46
51
47
-**Returns**: `Promise<ResolvedParams>`
52
-
53
48
-**On Success**: Resolves with `ResolvedParams`, an object containing _all_ query parameters parsed from the final redirect URL's query string. This occurs when the iframe redirects back to the same origin and its URL contains at least one key listed in `successParams` (and no keys listed in `errorParams`).
49
+
-**On Error Params**: Resolves with `ResolvedParams` containing _all_ parsed query parameters if the final redirect URL contains any key listed in `errorParams`. The caller must inspect the result for error keys.
54
50
-**On Failure**: Rejects with:
55
-
-`ResolvedParams`: An object containing _all_ parsed query parameters if the final redirect URL contains any key listed in `errorParams`.
56
51
- An object `{ type: 'internal_error', message: 'iframe timed out' }` if the specified `timeout` is reached before a success or error condition is met.
57
52
- An object `{ type: 'internal_error', message: 'unexpected failure' }` if there's an error accessing the iframe's content window (most likely due to a cross-origin redirect that wasn't expected or handled).
58
53
- An object `{ type: 'internal_error', message: 'error setting up iframe' }` if there was an issue creating or configuring the iframe initially.
@@ -63,7 +58,7 @@ This method creates a hidden iframe, initiates navigation, and waits for a redir
1.**Timeout:** Choose a reasonable `timeout` value. If the external service is slow or the redirect chain is long, the operation might time out prematurely. Conversely, too long a timeout might delay feedback to the user if something goes wrong.
118
118
1.**Intermediate Redirects:** The code handles intermediate redirects (pages loaded within the iframe that don't contain success or error parameters) by simply waiting for the next `load` event. The process only completes upon detecting success/error parameters or timing out.
119
119
1.**Cleanup:** The utility ensures the iframe element is removed from the DOM and the timeout timer is cleared upon completion (resolve, reject, or timeout) to prevent memory leaks.
120
-
1.**Error Parameter Precedence:** Error parameters (`errorParams`) are checked before success parameters (`successParams`). If a redirect URL contains both an error parameter and a success parameter, the promise will be **rejected**.
120
+
1.**Error Parameter Precedence:** Error parameters (`errorParams`) are checked before success parameters (`successParams`). If a redirect URL contains both an error parameter and a success parameter, the promise will **resolve** with all parameters, and the caller must check for the error parameter keys to determine it's an error state.
0 commit comments