Skip to content

Commit 7bd8519

Browse files
tweaks
1 parent 7053339 commit 7bd8519

File tree

1 file changed

+10
-10
lines changed
  • packages/@okta/vuepress-site/docs/guides/manage-user-creds/main

1 file changed

+10
-10
lines changed

packages/@okta/vuepress-site/docs/guides/manage-user-creds/main/index.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ The Okta Client SDKs are designed as a modular library ecosystem to ensure archi
4848

4949
The SDK's token management system is built on several key components that work together to provide a seamless and secure developer experience.
5050

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`.
5252
* `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.
5353
* `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.
5656

5757
## Store credentials
5858

@@ -64,7 +64,7 @@ After a user successfully signs in, you receive a `Token` object. The first step
6464
### JavaScript example: Store a token
6565

6666
```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 sign in
6868
try {
6969
// Store the token with an optional tag
7070
const credential = await Credential.store(newToken, ['service:purchase']);
@@ -98,7 +98,7 @@ For most single-user apps, you simplify the development process significantly by
9898
// User is signed in. Proceed to the main app view.
9999
showUserProfile(credential);
100100
} else {
101-
// No default user. Show the sign-in screen.
101+
// No default user. Show the sign-in page.
102102
showLoginScreen();
103103
}
104104

@@ -169,7 +169,7 @@ Access tokens are short-lived for security reasons. The SDK simplifies the proce
169169

170170
} catch (error) {
171171
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 sign in
173173
showLoginScreen();
174174
}
175175
}
@@ -179,7 +179,7 @@ Access tokens are short-lived for security reasons. The SDK simplifies the proce
179179
180180
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.
181181
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.
183183
* `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.
184184
* `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.
185185
@@ -192,13 +192,13 @@ When a user signs out or a session needs to be terminated, it's critical to prop
192192
await credential.revoke();
193193
console.log('User signed out and tokens revoked.');
194194

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
197197
redirectTo('/signin');
198198

199199
} catch (error) {
200200
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
202202
await credential.remove(); // Failsafe local removal
203203
redirectTo('/signin');
204204
}

0 commit comments

Comments
 (0)