Package com.inrupt.client.accessgrant
package com.inrupt.client.accessgrant
Classes for working with Access Grants.
This module provides utilities for using Access Grants in Solid Applications. There are three primary classes used for this.
AccessGrant: this class represents either a SolidAccessGrant
or a
SolidAccessRequest
. A developer can parse an AccessGrant
from a String
or
InputStream
in the following way:
try (InputStream stream = fetchAccessGrant()) {
AccessGrant accessGrant = AccessGrant.ofAccessGrant(data);
}
AccessGrantSession: this class can be used to build a Session
object that uses Access Grants when negotiating for access tokens. These sessions will also need an
OpenID-based session.
AccessGrant accessGrant1 = AccessGrant.ofAccessGrant(data1);
AccessGrant accessGrant2 = AccessGrant.ofAccessGrant(data2);
Session openid = OpenIdSession.ofIdToken(idToken);
Session session = AccessGrantSession.ofAccessGrant(openid, accessGrant1, accessGrant2);
SolidClient client = SolidClient.getClient().session(session);
AccessGrantClient: this class can be used for managing the lifecycle of Access Grants:
creation, deletion, revocation and query. This client will require a suitable
Session
object, typically an OpenID-based session:
URI SOLID_ACCESS_GRANT = URI.create("http://www.w3.org/ns/solid/vc#SolidAccessGrant");
URI issuer = URI.create("https://issuer.example");
Session openid = OpenIdSession.ofIdToken(idToken);
AccessGrantClient client = new AccessGrantClient(issuer).session(session);
URI resource = URI.create("https://storage.example/data/resource");
client.query(SOLID_ACCESS_GRANT, null, resource, null)
.thenApply(grants -> AccessGrantSession.ofAccessGrant(openid, grants.toArray(new AccessGrant[0])))
.thenApply(session -> SolidClient.getClient().session(session))
.thenAccept(cl -> {
// Do something with the Access Grant-scoped client
});
-
ClassDescriptionA base class for access credentials.User-managed credential data.Server-managed credential data.AccessCredentialQuery<T extends AccessCredential>An object to represent an access credential query.A builder class for access credential queries.The response from a verification operation.An Access Denial abstraction, for use when interacting with Solid resources.An Access Grant abstraction, for use when interacting with Solid resources.A client for interacting with and managing Access Grant Resources.A runtime exception for use with Access Grants.A session implementation that makes use of Access Grants.Utility methods for use with the Access Grant module.An Access Request abstraction, for use when interacting with Solid resources.A collection of parameters used for creating access requests.A class for building access request parameters.A class for representing status information of an Access Grant.