public class TokenApprovalStore extends Object implements ApprovalStore
ApprovalStore
that works with an existing TokenStore
, extracting implicit Approvals
from the content of tokens already in the store. Useful interface so that users can list and revoke
approvals even if they are not really represented in such a way internally. For full fine-grained control of user
approvals don't use a TokenStore at all, and don't use this ApprovalStore with Approval-based
AuthorizationServerTokenServices
implementations.Constructor and Description |
---|
TokenApprovalStore() |
Modifier and Type | Method and Description |
---|---|
boolean |
addApprovals(Collection<Approval> approvals)
This implementation is a no-op.
|
Collection<Approval> |
getApprovals(String userId,
String clientId)
Extract the implied approvals from any tokens associated with the user and client id supplied.
|
boolean |
revokeApprovals(Collection<Approval> approvals)
Revoke all tokens that match the client and user in the approvals supplied.
|
void |
setTokenStore(TokenStore store) |
public void setTokenStore(TokenStore store)
store
- the token store to setpublic boolean addApprovals(Collection<Approval> approvals)
TokenStore
is populated elsewhere, by (for example) a
token services instance that knows more about granted tokens than we could possibly infer from the approvals.addApprovals
in interface ApprovalStore
ApprovalStore.addApprovals(java.util.Collection)
public boolean revokeApprovals(Collection<Approval> approvals)
revokeApprovals
in interface ApprovalStore
ApprovalStore.revokeApprovals(java.util.Collection)
public Collection<Approval> getApprovals(String userId, String clientId)
getApprovals
in interface ApprovalStore
ApprovalStore.getApprovals(java.lang.String,
java.lang.String)
Copyright © 2019. All rights reserved.