Package com.inrupt.client.accessgrant
Class AccessGrantSession
- java.lang.Object
-
- com.inrupt.client.accessgrant.AccessGrantSession
-
-
Field Summary
Fields Modifier and Type Field Description static URI
VERIFIABLE_CREDENTIAL
The VerifiableCredential format URI, for use with UMA.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.static AccessGrantSession
ofAccessGrant(Session session, AccessGrant... accessGrants)
Create a session with a collection of known access grants.static AccessGrantSession
ofAccessGrant(Session session, ClientCache<URI,Credential> cache, AccessGrant... accessGrants)
Create a session with a collection of known access grants.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.
-
-
-
Field Detail
-
VERIFIABLE_CREDENTIAL
public static final URI VERIFIABLE_CREDENTIAL
The VerifiableCredential format URI, for use with UMA.
-
-
Method Detail
-
ofAccessGrant
public static AccessGrantSession ofAccessGrant(Session session, AccessGrant... accessGrants)
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
public String getId()
Description copied from interface:Session
Retrieve the identifier associated with this session.
-
reset
public void reset()
Description copied from interface:Session
Reset the session state, clearing any internal caches.
-
getPrincipal
public Optional<URI> getPrincipal()
Description copied from interface:Session
Retrieve the principal associated with this session.Typically, this will be a WebID or other globally unique value
- Specified by:
getPrincipal
in interfaceSession
- Returns:
- the principal identifier, if present
-
supportedSchemes
public Set<String> supportedSchemes()
Description copied from interface:Session
Retrieve the authentication schemes supported by this session.- Specified by:
supportedSchemes
in interfaceSession
- Returns:
- the scheme identifiers
-
getCredential
public Optional<Credential> getCredential(URI name, URI uri)
Description copied from interface:Session
Retrieve a credential from this session.- Specified by:
getCredential
in interfaceSession
- Parameters:
name
- the credential nameuri
- the request URI- Returns:
- the credential, if present
-
selectThumbprint
public Optional<String> selectThumbprint(Collection<String> algorithms)
Description copied from interface:Session
Select the thumbprint from a set of candidate algorithms.- Specified by:
selectThumbprint
in interfaceSession
- Parameters:
algorithms
- the supported algorithms- Returns:
- the keypair thumbprint
-
generateProof
public Optional<String> generateProof(String jkt, Request request)
Description copied from interface:Session
Generate a proof for a request.- Specified by:
generateProof
in 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:Session
Fetch an authentication token from session values.- Specified by:
authenticate
in 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
-
-