Package com.inrupt.client.accessgrant
Class AccessGrantSession
java.lang.Object
com.inrupt.client.accessgrant.AccessGrantSession
- All Implemented Interfaces:
Session
A session implementation that makes use of Access Grants.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final URIThe VerifiableCredential format URI, for use with UMA. -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(Authenticator authenticator, Request request, Set<String> algorithms) Fetch an authentication token from session values.Retrieve an access token for a request from a cache.generateProof(String jkt, Request request) Generate a proof for a request.getCredential(URI name, URI uri) Retrieve a credential from this session.getId()Retrieve the identifier associated with this session.Retrieve the principal associated with this session.static AccessGrantSessionofAccessGrant(Session session, AccessGrant... accessGrants) Create a session with a collection of known access grants.static AccessGrantSessionofAccessGrant(Session session, ClientCache<URI, Credential> cache, AccessGrant... accessGrants) Create a session with a collection of known access grants.voidreset()Reset the session state, clearing any internal caches.selectThumbprint(Collection<String> algorithms) Select the thumbprint from a set of candidate algorithms.Retrieve the authentication schemes supported by this session.
-
Field Details
-
VERIFIABLE_CREDENTIAL
The VerifiableCredential format URI, for use with UMA.
-
-
Method Details
-
ofAccessGrant
Create a session with a collection of known access grants.- Parameters:
session- the OpenID SessionaccessGrants- the access grants- Returns:
- the Access Grant-based session
-
ofAccessGrant
public static AccessGrantSession ofAccessGrant(Session session, ClientCache<URI, Credential> cache, AccessGrant... accessGrants) Create a session with a collection of known access grants.- Parameters:
session- the OpenID Sessioncache- a pre-configured cacheaccessGrants- the access grants- Returns:
- the Access Grant-based session
-
getId
Description copied from interface:SessionRetrieve the identifier associated with this session. -
reset
public void reset()Description copied from interface:SessionReset the session state, clearing any internal caches. -
getPrincipal
Description copied from interface:SessionRetrieve the principal associated with this session.Typically, this will be a WebID or other globally unique value
- Specified by:
getPrincipalin interfaceSession- Returns:
- the principal identifier, if present
-
supportedSchemes
Description copied from interface:SessionRetrieve the authentication schemes supported by this session.- Specified by:
supportedSchemesin interfaceSession- Returns:
- the scheme identifiers
-
getCredential
Description copied from interface:SessionRetrieve a credential from this session.- Specified by:
getCredentialin interfaceSession- Parameters:
name- the credential nameuri- the request URI- Returns:
- the credential, if present
-
selectThumbprint
Description copied from interface:SessionSelect the thumbprint from a set of candidate algorithms.- Specified by:
selectThumbprintin interfaceSession- Parameters:
algorithms- the supported algorithms- Returns:
- the keypair thumbprint
-
generateProof
Description copied from interface:SessionGenerate a proof for a request.- Specified by:
generateProofin interfaceSession- Parameters:
jkt- the JSON Key thumbprint for the proof keyrequest- the request- Returns:
- a proof token
-
authenticate
public CompletionStage<Optional<Credential>> authenticate(Authenticator authenticator, Request request, Set<String> algorithms) Description copied from interface:SessionFetch an authentication token from session values.- Specified by:
authenticatein interfaceSession- Parameters:
authenticator- the authenticator in userequest- the HTTP requestalgorithms- the supported DPoP algorithms- Returns:
- the next stage of completion, containing an access token, if present
-
fromCache
Description copied from interface:SessionRetrieve an access token for a request from a cache.
-