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/@okta/vuepress-site/docs/guides/manage-user-creds/main/index.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,11 +48,11 @@ The Okta Client SDKs are designed as a modular library ecosystem to ensure archi
48
48
49
49
The SDK's token management system is built on several key components that work together to provide a seamless and secure developer experience.
50
50
51
-
*`Credential`: This is the main convenience class for interacting with tokens. It acts as a runtime wrapper for a * `Token` object, exposing simplified methods for the entire token lifecycle. Each `Credential` instance is uniquely tied to a corresponding `Token`.
51
+
*`Credential`: This is the main convenience class for interacting with tokens. It acts as a runtime wrapper for a `Token` object, exposing simplified methods for the entire token lifecycle. Each `Credential` instance is uniquely tied to a corresponding `Token`.
52
52
*`Token`: An immutable data object representing the full set of OAuth 2.0 tokens (access token, refresh token, ID token) received from the authorization server. This object persists across app launches to keep your user signed in.
53
53
*`TokenStorage`: An interface responsible for the secure Create, Read, Update, and Delete (CRUD) operations of `Token` objects.
54
-
*`CredentialDataSource`: A factory that creates and caches `Credential` instances, ensuring only one unique instance exists at runtime for any given `Token`.
55
-
*`CredentialCoordinator`: The central orchestrator that manages interactions between all the above components to ensure data consistency.
54
+
*`CredentialDataSource`: A factory that creates and caches `Credential` instances, ensuring that only one unique instance exists at runtime for any given `Token`.
55
+
*`CredentialCoordinator`: The central orchestrator that manages interactions between all of the above components to ensure data consistency.
56
56
57
57
## Store credentials
58
58
@@ -64,7 +64,7 @@ After a user successfully signs in, you receive a `Token` object. The first step
64
64
### JavaScript example: Store a token
65
65
66
66
```javascript
67
-
// Assume 'newToken' is a Token object received after a successful sign-in
67
+
// Assume 'newToken' is a Token object received after a successful user signin
@@ -98,7 +98,7 @@ For most single-user apps, you simplify the development process significantly by
98
98
// User is signed in. Proceed to the main app view.
99
99
showUserProfile(credential);
100
100
} else {
101
-
// No default user. Show the sign-in screen.
101
+
// No default user. Show the sign-in page.
102
102
showLoginScreen();
103
103
}
104
104
@@ -169,7 +169,7 @@ Access tokens are short-lived for security reasons. The SDK simplifies the proce
169
169
170
170
} catch (error) {
171
171
console.error('API request failed. User may need to re-authenticate.', error);
172
-
// If refresh fails (e.g., refresh token is invalid), redirect to sign-in
172
+
// If refresh fails (for example, refresh token is invalid), redirect the user to signin
173
173
showLoginScreen();
174
174
}
175
175
}
@@ -179,7 +179,7 @@ Access tokens are short-lived for security reasons. The SDK simplifies the proce
179
179
180
180
When a user signs out or a session needs to be terminated, it's critical to properly remove the credentials from both the client and the server.
181
181
182
-
* `revoke()`: This function uses the Okta [revocation endpoint](https://developer.okta.com/docs/api/openapi/okta-oauth/oauth/tag/CustomAS/#tag/CustomAS/operation/revokeCustomAS) to invalidate the tokens on the authorization server. If successful, it automatically removes the credential from local storage. By default, this function revokes both the access and refresh tokens. This is the most secure way to sign out a user.
182
+
* `revoke()`: This function uses the Okta [revocation endpoint](https://developer.okta.com/docs/api/openapi/okta-oauth/oauth/tag/CustomAS/#tag/CustomAS/operation/revokeCustomAS) to invalidate the tokens on the authorization server. If successful, it automatically removes the credential from local storage. By default, this function revokes both the access and refresh tokens. This is the most secure way to sign a user out.
183
183
* `remove()`: This function only deletes the credential from the client-side `TokenStorage`. It doesn't invalidate the tokens on the server, and therefore poses a security risk if the tokens were compromised. Use this with caution.
184
184
* `SessionLogoutFlow()` or `signOut()`: For browser-based flows that create an Okta session cookie, you may need a specific sign-out function to clear the server-side session cookies in addition to revoking tokens.
185
185
@@ -192,13 +192,13 @@ When a user signs out or a session needs to be terminated, it's critical to prop
192
192
awaitcredential.revoke();
193
193
console.log('User signed out and tokens revoked.');
194
194
195
-
// The credential is also automatically removed from local storage.
196
-
// Now, redirect to the sign-in page.
195
+
// The credential is also automatically removed from local storage
196
+
// Now, redirect to the sign-in page
197
197
redirectTo('/signin');
198
198
199
199
} catch (error) {
200
200
console.error('Error during sign-out:', error);
201
-
// Even if server revocation fails, ensure local state is cleared and redirect
201
+
// Even if server revocation fails, ensure that local state is cleared and redirect
202
202
awaitcredential.remove(); // Failsafe local removal
0 commit comments