Package com.pingidentity.sdk.accessgrant
Interface AccessGrantManager
-
public interface AccessGrantManagerProvides the ability to create a custom Access Grant storage mechanism.- Since:
- 8.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voiddeleteExpiredGrants()PingFederate periodically calls this method (once per day by default) to clear out expired access grants.default voiddeleteGrant(String accessGrantGuid)Deletes an access grant that has been previously issued.default AccessGrantgetByAccessGrantCriteria(AccessGrantCriteria accessGrantCriteria)Retrieves an access grant based on several specific criteria specified in the params.Collection<AccessGrant>getByClientId(String clientId)Retrieves a collection of access grants based on the client id.AccessGrantgetByGuid(String accessGrantGuid)Retrieves an AccessGrant by its guid.AccessGrantgetByRefreshToken(String refreshTokenValue)Retrieves an AccessGrant by its refresh token value.Collection<AccessGrant>getByUserKey(String userKey)Retrieves an access grant based on the user key, which is the unique user identifier.default Collection<AccessGrant>getByUserKeyClientIdGrantType(String userKey, String clientId, String grantType)Retrieves a collection of access grants based on several specific criteria specified in the params.AccessGrantgetByUserKeyScopeClientIdGrantTypeContext(String userKey, Scope scope, String clientId, String grantType, String contextQualifier)Retrieves an access grant based on several specific criteria specified in the params.AccessGrantAttributesHoldergetGrantAttributes(String accessGrantGuid)Retrieve the access grant attributes for the specified access grant guid.booleanisDataSourceInUse(String datasourceId)Determines if the specified data source is in use.voidrevokeGrant(String accessGrantGuid)Revokes an access grant that has been previously issued.voidrevokeGrant(String userKey, String accessGrantGuid)Revokes an access grant that has been previously issued.voidsaveGrant(AccessGrant accessGrant, AccessGrantAttributesHolder attrHolder)Saves the access grant to the underlying storage mechanism.default voidupdateExpiry(AccessGrant accessGrant)Update the expiry time of the specified access grant.voidupdateGrantAttributes(String accessGrantGuid, AccessGrantAttributesHolder attrHolder)Updates the access grant attributes with the specified attributes.voidupdateRefreshToken(AccessGrant accessGrant)Update the refresh token of the specified access grant.
-
-
-
Method Detail
-
getByRefreshToken
AccessGrant getByRefreshToken(String refreshTokenValue) throws AccessGrantManagementException
Retrieves an AccessGrant by its refresh token value.- Parameters:
refreshTokenValue- the refresh token to search for.- Returns:
- An AccessGrant with a refresh token value matching the param.
- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.
-
getByGuid
AccessGrant getByGuid(String accessGrantGuid) throws AccessGrantManagementException
Retrieves an AccessGrant by its guid.- Parameters:
accessGrantGuid- the guid to search for.- Returns:
- An AccessGrant with a guid matching the param.
- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.
-
getByUserKey
Collection<AccessGrant> getByUserKey(String userKey) throws AccessGrantManagementException
Retrieves an access grant based on the user key, which is the unique user identifier.- Parameters:
userKey- the unique user identifier to retrieve access grants for.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.
-
getByUserKeyScopeClientIdGrantTypeContext
AccessGrant getByUserKeyScopeClientIdGrantTypeContext(String userKey, Scope scope, String clientId, String grantType, String contextQualifier) throws AccessGrantManagementException
Retrieves an access grant based on several specific criteria specified in the params.- Parameters:
userKey- the unique user identifier to retrieve access grants for.scope- the scope to retrieve access grants for.clientId- the client id to retrieve access grants for.grantType- the grant type to retrieve access grants for.contextQualifier- the contextual qualifier to retrieve access grants for.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.
-
getByAccessGrantCriteria
default AccessGrant getByAccessGrantCriteria(AccessGrantCriteria accessGrantCriteria) throws AccessGrantManagementException
Retrieves an access grant based on several specific criteria specified in the params.- Parameters:
accessGrantCriteria- the access grant criteria to retrieve access grants for.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.
-
getByClientId
Collection<AccessGrant> getByClientId(String clientId) throws AccessGrantManagementException
Retrieves a collection of access grants based on the client id.- Parameters:
clientId- the client id to retrieve access grants for.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.
-
getByUserKeyClientIdGrantType
default Collection<AccessGrant> getByUserKeyClientIdGrantType(String userKey, String clientId, String grantType) throws AccessGrantManagementException
Retrieves a collection of access grants based on several specific criteria specified in the params.- Parameters:
userKey- the unique user identifier to retrieve access grants for.clientId- the client id to retrieve access grants for.grantType- the grant type to retrieve access grants for.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.- Since:
- 12.0
-
revokeGrant
void revokeGrant(String accessGrantGuid) throws AccessGrantManagementException
Revokes an access grant that has been previously issued.- Parameters:
accessGrantGuid- the guid of the access grant that is to be revoked.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.
-
revokeGrant
void revokeGrant(String userKey, String accessGrantGuid) throws AccessGrantManagementException
Revokes an access grant that has been previously issued.- Parameters:
userKey- the user identifier of the access grant to be revoked.accessGrantGuid- the guid of the access grant that is to be revoked.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.
-
deleteGrant
default void deleteGrant(String accessGrantGuid) throws AccessGrantManagementException
Deletes an access grant that has been previously issued. The methodrevokeGrant(String)deletes an access grant and may take further action to notify the deletion. Override this method to delete an access grant from the underlying storage mechanism and take no further action.- Parameters:
accessGrantGuid- the guid of the access grant that is to be revoked.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.- Since:
- 12.0
-
saveGrant
void saveGrant(AccessGrant accessGrant, AccessGrantAttributesHolder attrHolder) throws AccessGrantManagementException
Saves the access grant to the underlying storage mechanism.- Parameters:
accessGrant- the access grant that is to be persisted.attrHolder- a list of optional access grant attributes to be stored with the access grant.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.
-
updateGrantAttributes
void updateGrantAttributes(String accessGrantGuid, AccessGrantAttributesHolder attrHolder) throws AccessGrantManagementException
Updates the access grant attributes with the specified attributes.- Parameters:
accessGrantGuid- the guid of the access grant that is to be updated.attrHolder- a list of optional access grant attributes that are to be updated within the access grant.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.
-
updateRefreshToken
void updateRefreshToken(AccessGrant accessGrant) throws AccessGrantManagementException
Update the refresh token of the specified access grant. Use the guid specified in the accessGrant param as the key to perform the update. The hashedRefreshTokenValue variable passed in the accessGrant will contain the new refresh value. Implementations are responsible for ensuring the updated timestamp on persisted access grants is current.- Parameters:
accessGrant- the access grant to update which contains the new refresh token value.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.
-
updateExpiry
default void updateExpiry(AccessGrant accessGrant) throws AccessGrantManagementException
Update the expiry time of the specified access grant. Use the guid specified in the accessGrant param as the key to perform the update. The expires variable passed in the accessGrant will contain the expiry time. Implementations are responsible for ensuring the updated timestamp on persisted access grants is current.- Parameters:
accessGrant- the access grant to update which contains the new expiry time.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.- Since:
- 12.0
-
isDataSourceInUse
boolean isDataSourceInUse(String datasourceId)
Determines if the specified data source is in use. Unless you are using the built-in JDBC, LDAP or custom data stores within PingFederate, this can simply return false.- Parameters:
datasourceId- the datasource id in use.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.
-
deleteExpiredGrants
void deleteExpiredGrants()
PingFederate periodically calls this method (once per day by default) to clear out expired access grants. When this method is invoked, cycle through all access grants and delete any that are expired.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.
-
getGrantAttributes
AccessGrantAttributesHolder getGrantAttributes(String accessGrantGuid) throws AccessGrantManagementException
Retrieve the access grant attributes for the specified access grant guid.- Parameters:
accessGrantGuid- the access grant guid to retrieve attributes for.- Throws:
AccessGrantManagementException- Runtime exception to indicate the retrieval of the AccessGrant has failed.
-
-