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
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Session
anonymous()
Create a new anonymous session.CompletionStage<Optional<Credential>>
authenticate(Authenticator authenticator, Request request, Set<String> algorithms)
Fetch an authentication token from session values.Optional<Credential>
fromCache(Request request)
Retrieve an access token for a request from a cache.Optional<String>
generateProof(String jkt, Request request)
Generate a proof for a request.Optional<Credential>
getCredential(URI name, URI uri)
Retrieve a credential from this session.String
getId()
Retrieve the identifier associated with this session.Optional<URI>
getPrincipal()
Retrieve the principal associated with this session.void
reset()
Reset the session state, clearing any internal caches.Optional<String>
selectThumbprint(Collection<String> algorithms)
Select the thumbprint from a set of candidate algorithms.Set<String>
supportedSchemes()
Retrieve the authentication schemes supported by this session.
-
-
-
Method Detail
-
getId
String getId()
Retrieve the identifier associated with this session.- Returns:
- a session identifier
-
getPrincipal
Optional<URI> 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
Set<String> supportedSchemes()
Retrieve the authentication schemes supported by this session.- Returns:
- the scheme identifiers
-
getCredential
Optional<Credential> getCredential(URI name, URI uri)
Retrieve a credential from this session.- Parameters:
name
- the credential nameuri
- the request URI- Returns:
- the credential, if present
-
fromCache
Optional<Credential> fromCache(Request request)
Retrieve an access token for a request from a cache.- Parameters:
request
- the HTTP request- Returns:
- the access token, if present
-
generateProof
Optional<String> generateProof(String jkt, Request request)
Generate a proof for a request.- Parameters:
jkt
- the JSON Key thumbprint for the proof keyrequest
- the request- Returns:
- a proof token
-
selectThumbprint
Optional<String> selectThumbprint(Collection<String> algorithms)
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
-
-