Package com.inrupt.client.auth
Interface Session
- All Known Implementing Classes:
AccessGrantSession
,OpenIdSession
public interface Session
An interface for working with session objects.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Session
Create a new anonymous session.authenticate
(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.void
reset()
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.
-
Method Details
-
getId
String getId()Retrieve the identifier associated with this session.- Returns:
- a session identifier
-
getPrincipal
Retrieve the principal associated with this session.Typically, this will be a WebID or other globally unique value
- Returns:
- the principal identifier, if present
-
supportedSchemes
Retrieve the authentication schemes supported by this session.- Returns:
- the scheme identifiers
-
getCredential
Retrieve a credential from this session.- Parameters:
name
- the credential nameuri
- the request URI- Returns:
- the credential, if present
-
fromCache
Retrieve an access token for a request from a cache.- Parameters:
request
- the HTTP request- Returns:
- the access token, if present
-
generateProof
Generate a proof for a request.- Parameters:
jkt
- the JSON Key thumbprint for the proof keyrequest
- the request- Returns:
- a proof token
-
selectThumbprint
Select the thumbprint from a set of candidate algorithms.- Parameters:
algorithms
- the supported algorithms- Returns:
- the keypair thumbprint
-
reset
void reset()Reset the session state, clearing any internal caches. -
authenticate
CompletionStage<Optional<Credential>> authenticate(Authenticator authenticator, Request request, Set<String> algorithms) Fetch an authentication token from session values.- 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
-
anonymous
Create a new anonymous session.- Returns:
- the session
- Implementation Note:
- This
Session
does not keep a cache of access tokens.
-