Package com.okta.sdk.resource.api
Class UserGrantApi
java.lang.Object
com.okta.sdk.resource.api.UserGrantApi
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
date="2026-03-13T17:36:05.533634+05:30[Asia/Kolkata]",
comments="Generator version: 7.15.0")
public class UserGrantApi
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static com.fasterxml.jackson.databind.ObjectMappergetUserGrant(String userId, String grantId, String expand) Retrieve a user grant Retrieves a grant for the specified userRetrieve a user grant Retrieves a grant for the specified userlistGrantsForUserAndClient(String userId, String clientId, String expand, String after, Integer limit) List all grants for a client Lists all grants for a specified user and clientlistGrantsForUserAndClient(String userId, String clientId, String expand, String after, Integer limit, Map<String, String> additionalHeaders) List all grants for a client Lists all grants for a specified user and clientlistGrantsForUserAndClientPaged(String userId, String clientId, String expand, String after, Integer limit) List all grants for a client (Paginated) Lists all grants for a specified user and client This method returns a lazy, paginated iterable that automatically handles pagination.listGrantsForUserAndClientPaged(String userId, String clientId, String expand, String after, Integer limit, Map<String, String> additionalHeaders) List all grants for a client (Paginated with additional headers) Lists all grants for a specified user and client This method returns a lazy, paginated iterable that automatically handles pagination.List all user grants Lists all grants for the specified userlistUserGrants(String userId, String scopeId, String expand, String after, Integer limit, Map<String, String> additionalHeaders) List all user grants Lists all grants for the specified userList all user grants (Paginated) Lists all grants for the specified user This method returns a lazy, paginated iterable that automatically handles pagination.listUserGrantsPaged(String userId, String scopeId, String expand, String after, Integer limit, Map<String, String> additionalHeaders) List all user grants (Paginated with additional headers) Lists all grants for the specified user This method returns a lazy, paginated iterable that automatically handles pagination.voidrevokeGrantsForUserAndClient(String userId, String clientId) Revoke all grants for a client Revokes all grants for the specified user and clientvoidRevoke all grants for a client Revokes all grants for the specified user and clientvoidrevokeUserGrant(String userId, String grantId) Revoke a user grant Revokes one grant for a specified uservoidRevoke a user grant Revokes one grant for a specified uservoidrevokeUserGrants(String userId) Revoke all user grants Revokes all grants for a specified uservoidrevokeUserGrants(String userId, Map<String, String> additionalHeaders) Revoke all user grants Revokes all grants for a specified uservoidsetApiClient(ApiClient apiClient)
-
Constructor Details
-
UserGrantApi
public UserGrantApi() -
UserGrantApi
-
-
Method Details
-
getApiClient
-
setApiClient
-
getUserGrant
public OAuth2ScopeConsentGrant getUserGrant(String userId, String grantId, String expand) throws ApiException Retrieve a user grant Retrieves a grant for the specified user- Parameters:
userId- ID of an existing Okta user (required)grantId- Grant ID (required)expand- Valid value: `scope`. If specified, scope details are included in the `_embedded` attribute. (optional)- Returns:
- OAuth2ScopeConsentGrant
- Throws:
ApiException- if fails to make API call
-
getUserGrant
public OAuth2ScopeConsentGrant getUserGrant(String userId, String grantId, String expand, Map<String, String> additionalHeaders) throws ApiExceptionRetrieve a user grant Retrieves a grant for the specified user- Parameters:
userId- ID of an existing Okta user (required)grantId- Grant ID (required)expand- Valid value: `scope`. If specified, scope details are included in the `_embedded` attribute. (optional)additionalHeaders- additionalHeaders for this call- Returns:
- OAuth2ScopeConsentGrant
- Throws:
ApiException- if fails to make API call
-
listGrantsForUserAndClient
public List<OAuth2ScopeConsentGrant> listGrantsForUserAndClient(String userId, String clientId, String expand, String after, Integer limit) throws ApiException List all grants for a client Lists all grants for a specified user and client- Parameters:
userId- ID of an existing Okta user (required)clientId- `client_id` of the app (required)expand- Valid value: `scope`. If specified, scope details are included in the `_embedded` attribute. (optional)after- The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)limit- Specifies the number of tokens to return (optional, default to 20)- Returns:
- List<OAuth2ScopeConsentGrant>
- Throws:
ApiException- if fails to make API call
-
listGrantsForUserAndClient
public List<OAuth2ScopeConsentGrant> listGrantsForUserAndClient(String userId, String clientId, String expand, String after, Integer limit, Map<String, String> additionalHeaders) throws ApiExceptionList all grants for a client Lists all grants for a specified user and client- Parameters:
userId- ID of an existing Okta user (required)clientId- `client_id` of the app (required)expand- Valid value: `scope`. If specified, scope details are included in the `_embedded` attribute. (optional)after- The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)limit- Specifies the number of tokens to return (optional, default to 20)additionalHeaders- additionalHeaders for this call- Returns:
- List<OAuth2ScopeConsentGrant>
- Throws:
ApiException- if fails to make API call
-
listGrantsForUserAndClientPaged
public Iterable<OAuth2ScopeConsentGrant> listGrantsForUserAndClientPaged(String userId, String clientId, String expand, String after, Integer limit) List all grants for a client (Paginated) Lists all grants for a specified user and client This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks. Use this method in a for-each loop to automatically fetch all pages without manual cursor management.- Parameters:
userId- ID of an existing Okta user (required)clientId- `client_id` of the app (required)expand- Valid value: `scope`. If specified, scope details are included in the `_embedded` attribute. (optional)after- The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)limit- Specifies the number of tokens to return (optional, default to 20)- Returns:
- Iterable<OAuth2ScopeConsentGrant> lazy iterable over all pages
-
listGrantsForUserAndClientPaged
public Iterable<OAuth2ScopeConsentGrant> listGrantsForUserAndClientPaged(String userId, String clientId, String expand, String after, Integer limit, Map<String, String> additionalHeaders) List all grants for a client (Paginated with additional headers) Lists all grants for a specified user and client This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks.- Parameters:
userId- ID of an existing Okta user (required)clientId- `client_id` of the app (required)expand- Valid value: `scope`. If specified, scope details are included in the `_embedded` attribute. (optional)after- The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)limit- Specifies the number of tokens to return (optional, default to 20)additionalHeaders- additional headers for this call- Returns:
- Iterable<OAuth2ScopeConsentGrant> lazy iterable over all pages
-
listUserGrants
public List<OAuth2ScopeConsentGrant> listUserGrants(String userId, String scopeId, String expand, String after, Integer limit) throws ApiException List all user grants Lists all grants for the specified user- Parameters:
userId- ID of an existing Okta user (required)scopeId- The scope ID to filter on (optional)expand- Valid value: `scope`. If specified, scope details are included in the `_embedded` attribute. (optional)after- The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)limit- Specifies the number of grants to return (optional, default to 20)- Returns:
- List<OAuth2ScopeConsentGrant>
- Throws:
ApiException- if fails to make API call
-
listUserGrants
public List<OAuth2ScopeConsentGrant> listUserGrants(String userId, String scopeId, String expand, String after, Integer limit, Map<String, String> additionalHeaders) throws ApiExceptionList all user grants Lists all grants for the specified user- Parameters:
userId- ID of an existing Okta user (required)scopeId- The scope ID to filter on (optional)expand- Valid value: `scope`. If specified, scope details are included in the `_embedded` attribute. (optional)after- The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)limit- Specifies the number of grants to return (optional, default to 20)additionalHeaders- additionalHeaders for this call- Returns:
- List<OAuth2ScopeConsentGrant>
- Throws:
ApiException- if fails to make API call
-
listUserGrantsPaged
public Iterable<OAuth2ScopeConsentGrant> listUserGrantsPaged(String userId, String scopeId, String expand, String after, Integer limit) List all user grants (Paginated) Lists all grants for the specified user This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks. Use this method in a for-each loop to automatically fetch all pages without manual cursor management.- Parameters:
userId- ID of an existing Okta user (required)scopeId- The scope ID to filter on (optional)expand- Valid value: `scope`. If specified, scope details are included in the `_embedded` attribute. (optional)after- The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)limit- Specifies the number of grants to return (optional, default to 20)- Returns:
- Iterable<OAuth2ScopeConsentGrant> lazy iterable over all pages
-
listUserGrantsPaged
public Iterable<OAuth2ScopeConsentGrant> listUserGrantsPaged(String userId, String scopeId, String expand, String after, Integer limit, Map<String, String> additionalHeaders) List all user grants (Paginated with additional headers) Lists all grants for the specified user This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks.- Parameters:
userId- ID of an existing Okta user (required)scopeId- The scope ID to filter on (optional)expand- Valid value: `scope`. If specified, scope details are included in the `_embedded` attribute. (optional)after- The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)limit- Specifies the number of grants to return (optional, default to 20)additionalHeaders- additional headers for this call- Returns:
- Iterable<OAuth2ScopeConsentGrant> lazy iterable over all pages
-
revokeGrantsForUserAndClient
Revoke all grants for a client Revokes all grants for the specified user and client- Parameters:
userId- ID of an existing Okta user (required)clientId- `client_id` of the app (required)- Throws:
ApiException- if fails to make API call
-
revokeGrantsForUserAndClient
public void revokeGrantsForUserAndClient(String userId, String clientId, Map<String, String> additionalHeaders) throws ApiExceptionRevoke all grants for a client Revokes all grants for the specified user and client- Parameters:
userId- ID of an existing Okta user (required)clientId- `client_id` of the app (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
revokeUserGrant
Revoke a user grant Revokes one grant for a specified user- Parameters:
userId- ID of an existing Okta user (required)grantId- Grant ID (required)- Throws:
ApiException- if fails to make API call
-
revokeUserGrant
public void revokeUserGrant(String userId, String grantId, Map<String, String> additionalHeaders) throws ApiExceptionRevoke a user grant Revokes one grant for a specified user- Parameters:
userId- ID of an existing Okta user (required)grantId- Grant ID (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
revokeUserGrants
Revoke all user grants Revokes all grants for a specified user- Parameters:
userId- ID of an existing Okta user (required)- Throws:
ApiException- if fails to make API call
-
revokeUserGrants
public void revokeUserGrants(String userId, Map<String, String> additionalHeaders) throws ApiExceptionRevoke all user grants Revokes all grants for a specified user- Parameters:
userId- ID of an existing Okta user (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
getObjectMapper
protected static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-