@inrupt/solid-client-access-grants / gConsent

Module: gConsent#

References#

AccessBaseOptions#

Re-exports AccessBaseOptions


IssueAccessRequestParameters#

Re-exports IssueAccessRequestParameters

Type Aliases#

AccessCredentialType#

Ƭ AccessCredentialType: typeof ACCESS_CREDENTIAL_TYPE extends Set<infer T> ? T : never

Defined in#

src/gConsent/type/AccessCredentialType.ts:24


AccessGrant#

Ƭ AccessGrant: VerifiableCredential & AccessGrantBody

Defined in#

src/gConsent/type/AccessGrant.ts:25


AccessGrantContext#

Ƭ AccessGrantContext: typeof ACCESS_GRANT_CONTEXT_DEFAULT

Defined in#

src/gConsent/type/AccessGrantContext.ts:24


AccessGrantGConsent#

Ƭ AccessGrantGConsent: AccessGrant

Defined in#

src/gConsent/type/AccessGrant.ts:28


AccessRequest#

Ƭ AccessRequest: VerifiableCredential & AccessRequestBody

Defined in#

src/gConsent/type/AccessRequest.ts:25


AccessRequestGConsent#

Ƭ AccessRequestGConsent: AccessRequest

Defined in#

src/gConsent/type/AccessRequest.ts:28


ApproveAccessRequestOverrides#

Ƭ ApproveAccessRequestOverrides: Omit<Omit<AccessGrantParameters, "status">, "expirationDate"> & { expirationDate?: Date | null }

Defined in#

src/gConsent/manage/approveAccessRequest.ts:54


RedirectToAccessManagementUiOptions#

Ƭ RedirectToAccessManagementUiOptions: RedirectOptions & FetchOptions & { fallbackAccessManagementUi?: UrlString ; resourceOwner?: WebId }

Optional parameters for the [[redirectToAccessManagementUi]] method:

  • fetch?: Pass in a function with a signature compatible with the WHATWG Fetch API, which will be used to make HTTP requests. Primarily useful when requests need to be authenticated. When @inrupt/solid-client-authn-browser is available and this property is not set, fetch will be imported from there. Otherwise, the HTTP requests will be unauthenticated.

  • redirectCallback?: For use in a non-browser environment, this must be provided by the user in order to handle the redirect URL, since setting window.location.href is not an option.

Since

0.4.0

Defined in#

src/gConsent/discover/redirectToAccessManagementUi.ts:56

Variables#

GRANT_VC_URL_PARAM_NAME#

Const GRANT_VC_URL_PARAM_NAME: "accessGrantUrl"

Defined in#

src/gConsent/manage/redirectToRequestor.ts:26


REDIRECT_URL_PARAM_NAME#

Const REDIRECT_URL_PARAM_NAME: "redirectUrl"

Defined in#

src/gConsent/discover/redirectToAccessManagementUi.ts:39


REQUEST_VC_URL_PARAM_NAME#

Const REQUEST_VC_URL_PARAM_NAME: "requestVcUrl"

Defined in#

src/gConsent/discover/redirectToAccessManagementUi.ts:38

Functions#

approveAccessRequest#

approveAccessRequest(requestVc, requestOverride, options): Promise<DatasetWithId>

Approve an access request. The content of the approved access request is provided as a Verifiable Credential which properties may be overridden if necessary.

Parameters#

Name

Type

Description

requestVc

string | URL | DatasetWithId | VerifiableCredential

The Verifiable Credential representing the Access Request. If not conform to an Access Request, the function will throw.

requestOverride

Partial<ApproveAccessRequestOverrides>

Elements overriding information from the provided Verifiable Credential.

options

AccessBaseOptions & { returnLegacyJsonld: false }

Optional properties to customizes the access grant behavior. Options include updateAcr which defaults to true. If this flag is set to true, the ACR of the Resource will be updated when the access grant is approved. If this flag is set to false, the ACR of the Resource will remain unchanged. This is an advanced feature, and only users having a good understanding of the relationship between Access Grants and ACRs should deviate from the default. Additional information is available in the ESS documentation

Returns#

Promise<DatasetWithId>

A Verifiable Credential representing the granted access.

Since

0.0.1.

Defined in#

src/gConsent/manage/approveAccessRequest.ts:161

approveAccessRequest(requestVc, requestOverride?, options?): Promise<AccessGrant>

Approve an access request. The content of the approved access request is provided as a Verifiable Credential which properties may be overridden if necessary.

Parameters#

Name

Type

Description

requestVc

string | URL | DatasetWithId | VerifiableCredential

The Verifiable Credential representing the Access Request. If not conform to an Access Request, the function will throw.

requestOverride?

Partial<ApproveAccessRequestOverrides>

Elements overriding information from the provided Verifiable Credential.

options?

AccessBaseOptions & { returnLegacyJsonld?: true }

Optional properties to customizes the access grant behavior. Options include updateAcr which defaults to true. If this flag is set to true, the ACR of the Resource will be updated when the access grant is approved. If this flag is set to false, the ACR of the Resource will remain unchanged. This is an advanced feature, and only users having a good understanding of the relationship between Access Grants and ACRs should deviate from the default. Additional information is available in the ESS documentation

Returns#

Promise<AccessGrant>

A Verifiable Credential representing the granted access.

Since

0.0.1.

Deprecated

Set the options flag returnLegacyJsonLd to false, and prefer using the RDFJS interfaces.

Defined in#

src/gConsent/manage/approveAccessRequest.ts:189

approveAccessRequest(requestVc, requestOverride?, options?): Promise<DatasetWithId>

Approve an access request. The content of the approved access request is provided as a Verifiable Credential which properties may be overridden if necessary.

Parameters#

Name

Type

Description

requestVc

string | URL | DatasetWithId | VerifiableCredential

The Verifiable Credential representing the Access Request. If not conform to an Access Request, the function will throw.

requestOverride?

Partial<ApproveAccessRequestOverrides>

Elements overriding information from the provided Verifiable Credential.

options?

AccessBaseOptions & { returnLegacyJsonld?: boolean }

Optional properties to customizes the access grant behavior. Options include updateAcr which defaults to true. If this flag is set to true, the ACR of the Resource will be updated when the access grant is approved. If this flag is set to false, the ACR of the Resource will remain unchanged. This is an advanced feature, and only users having a good understanding of the relationship between Access Grants and ACRs should deviate from the default. Additional information is available in the ESS documentation

Returns#

Promise<DatasetWithId>

A Verifiable Credential representing the granted access.

Since

0.0.1.

Deprecated

Set the options flag returnLegacyJsonLd to false, and prefer using the RDFJS interfaces.

Defined in#

src/gConsent/manage/approveAccessRequest.ts:217

approveAccessRequest(requestVc, requestOverride, options): Promise<DatasetWithId>

Approve an access request. The content of the approved access request is provided as a set of claims, and no input Verifiable Credential is expected.

Parameters#

Name

Type

Description

requestVc

undefined

A Verifiable Credential that would represent the Access Request if provided.

requestOverride

ApproveAccessRequestOverrides

Claims constructing the Access Grant.

options

AccessBaseOptions & { returnLegacyJsonld: false }

Optional properties to customise the access grant behaviour.

Returns#

Promise<DatasetWithId>

A Verifiable Credential representing the granted access.

Since

0.0.1.

Defined in#

src/gConsent/manage/approveAccessRequest.ts:236

approveAccessRequest(requestVc, requestOverride, options?): Promise<AccessGrant>

Approve an access request. The content of the approved access request is provided as a set of claims, and no input Verifiable Credential is expected.

Parameters#

Name

Type

Description

requestVc

undefined

A Verifiable Credential that would represent the Access Request if provided.

requestOverride

ApproveAccessRequestOverrides

Claims constructing the Access Grant.

options?

AccessBaseOptions & { returnLegacyJsonld?: true }

Optional properties to customise the access grant behaviour.

Returns#

Promise<AccessGrant>

A Verifiable Credential representing the granted access.

Since

0.0.1.

Deprecated

Set the options flag returnLegacyJsonLd to false, and prefer using the RDFJS interfaces.

Defined in#

src/gConsent/manage/approveAccessRequest.ts:255

approveAccessRequest(requestVc, requestOverride, options?): Promise<DatasetWithId>

Approve an access request. The content of the approved access request is provided as a set of claims, and no input Verifiable Credential is expected.

Parameters#

Name

Type

Description

requestVc

undefined

A Verifiable Credential that would represent the Access Request if provided.

requestOverride

ApproveAccessRequestOverrides

Claims constructing the Access Grant.

options?

AccessBaseOptions & WithLegacyJsonFlag

Optional properties to customise the access grant behaviour.

Returns#

Promise<DatasetWithId>

A Verifiable Credential representing the granted access.

Since

0.0.1.

Deprecated

Set the options flag returnLegacyJsonLd to false, and prefer using the RDFJS interfaces.

Defined in#

src/gConsent/manage/approveAccessRequest.ts:274


cancelAccessRequest#

cancelAccessRequest(vc, options?): Promise<void>

Cancel a request for access to data (with explicit or implicit consent) before the person being asked for access has replied. This is equivalent to revoking a access grant.

Parameters#

Name

Type

Description

vc

string | URL | DatasetWithId | VerifiableCredential

The access request, either in the form of a VC URL or a full-fledged VC.

options

AccessBaseOptions

Optional properties to customise the access request behaviour.

Returns#

Promise<void>

A void promise

Since

0.0.1

Defined in#

src/gConsent/request/cancelAccessRequest.ts:40


denyAccessRequest#

denyAccessRequest(vc, options): Promise<DatasetWithId>

Deny an access request. The content of the denied access request is provided as a Verifiable Credential.

Parameters#

Name

Type

Description

vc

string | URL | DatasetWithId | VerifiableCredential

The Verifiable Credential representing the Access Request. If not conform to an Access Request, the function will throw.

options

AccessBaseOptions & { returnLegacyJsonld: false }

Optional properties to customise the access denial behaviour.

Returns#

Promise<DatasetWithId>

A Verifiable Credential representing the denied access.

Since

0.0.1

Defined in#

src/gConsent/manage/denyAccessRequest.ts:46

denyAccessRequest(vc, options?): Promise<AccessGrant>

Deny an access request. The content of the denied access request is provided as a Verifiable Credential.

Parameters#

Name

Type

Description

vc

string | URL | DatasetWithId | VerifiableCredential

The Verifiable Credential representing the Access Request. If not conform to an Access Request, the function will throw.

options?

AccessBaseOptions & { returnLegacyJsonld?: true }

Optional properties to customise the access denial behaviour.

Returns#

Promise<AccessGrant>

A Verifiable Credential representing the denied access.

Since

0.0.1

Deprecated

Deprecated in favour of setting returnLegacyJsonld: false. This will be the default value in future versions of this library.

Defined in#

src/gConsent/manage/denyAccessRequest.ts:64

denyAccessRequest(vc, options?): Promise<DatasetWithId>

Deny an access request. The content of the denied access request is provided as a Verifiable Credential.

Parameters#

Name

Type

Description

vc

string | URL | DatasetWithId | VerifiableCredential

The Verifiable Credential representing the Access Request. If not conform to an Access Request, the function will throw.

options?

AccessBaseOptions & { returnLegacyJsonld?: boolean }

Optional properties to customise the access denial behaviour.

Returns#

Promise<DatasetWithId>

A Verifiable Credential representing the denied access.

Since

0.0.1

Deprecated

Deprecated in favour of setting returnLegacyJsonld: false. This will be the default value in future versions of this library.

Defined in#

src/gConsent/manage/denyAccessRequest.ts:82


getAccessApiEndpoint#

getAccessApiEndpoint(resource, options?): Promise<UrlString>

Discovers the endpoint where access requests may be created for a given resource.

Parameters#

Name

Type

Description

resource

string | URL

The resource for which access may be requested.

options

AccessBaseOptions

Optional properties to customise the access request behaviour.

Returns#

Promise<UrlString>

The URL of the access request server.

Since

0.4.0

Defined in#

src/gConsent/discover/getAccessApiEndpoint.ts:69


getAccessGrant#

getAccessGrant(accessGrantVcUrl, options): Promise<DatasetWithId>

Retrieve the Access Grant associated to the given URL.

Parameters#

Name

Type

Description

accessGrantVcUrl

string | URL

The URL of an access grant, with or without consent.

options

AccessBaseOptions & { returnLegacyJsonld: false }

Optional properties to customise the request behaviour.

Returns#

Promise<DatasetWithId>

The Verifiable Credential associated to the given IRI, if it is an access grant. Throws otherwise.

Since

0.4.0

Defined in#

src/gConsent/manage/getAccessGrant.ts:43

getAccessGrant(accessGrantVcUrl, options?): Promise<AccessGrant>

Retrieve the Access Grant associated to the given URL.

Parameters#

Name

Type

Description

accessGrantVcUrl

string | URL

The URL of an access grant, with or without consent.

options?

AccessBaseOptions & { returnLegacyJsonld?: true }

Optional properties to customise the request behaviour.

Returns#

Promise<AccessGrant>

The Verifiable Credential associated to the given IRI, if it is an access grant. Throws otherwise.

Since

0.4.0

Deprecated

set returnLegacyJsonld: false and use RDFJS API

Defined in#

src/gConsent/manage/getAccessGrant.ts:58

getAccessGrant(accessGrantVcUrl, options?): Promise<DatasetWithId>

Retrieve the Access Grant associated to the given URL.

Parameters#

Name

Type

Description

accessGrantVcUrl

string | URL

The URL of an access grant, with or without consent.

options?

AccessBaseOptions & { returnLegacyJsonld?: boolean }

Optional properties to customise the request behaviour.

Returns#

Promise<DatasetWithId>

The Verifiable Credential associated to the given IRI, if it is an access grant. Throws otherwise.

Since

0.4.0

Deprecated

set returnLegacyJsonld: false and use RDFJS API

Defined in#

src/gConsent/manage/getAccessGrant.ts:73


getAccessGrantAll#

getAccessGrantAll(params, options): Promise<DatasetWithId[]>

Retrieve Access Grants issued over a resource. The Access Grants may be filtered by resource, requestor, access modes and purpose.

If a resource filter is specified, the resources hierarchy is walked up to the storage root so that all applicable Access Grants for the target resource are discovered, including recursive Access Grants issued over an ancestor container.

Parameters#

Name

Type

Description

params

Partial<Pick<InputAccessRequestParameters, "access" | "purpose"> & { requestor: string ; resource: string | URL ; status?: "all" | "denied" | "granted" }>

-

options

QueryOptions & { returnLegacyJsonld: false }

Optional parameter: - options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API. This is typically used for authentication. - options.includeExpiredGrants: include expired grants in the result set. - accessEndpoint: A base URL used when determining the location of access API calls. If not given, it is attempted to be found by determining the server URL from the resource involved in the request and reading its .well-known/solid file for an Access API entry. If you are not providing a resource this url must point to the vcProvider endpoint associated with the environment you are requesting against.

Returns#

Promise<DatasetWithId[]>

A promise resolving to an array of Access Grants matching the request.

Example

Since

0.4.0

Defined in#

src/gConsent/manage/getAccessGrantAll.ts:129

getAccessGrantAll(params, options?): Promise<VerifiableCredential[]>

Parameters#

Name

Type

params

Partial<Pick<InputAccessRequestParameters, "access" | "purpose"> & { requestor: string ; resource: string | URL ; status?: "all" | "denied" | "granted" }>

options?

QueryOptions & { returnLegacyJsonld?: true }

Returns#

Promise<VerifiableCredential[]>

Deprecated

Please set returnLegacyJsonld: false and use RDFJS API

Defined in#

src/gConsent/manage/getAccessGrantAll.ts:138

getAccessGrantAll(params, options?): Promise<DatasetWithId[]>

Parameters#

Name

Type

params

Partial<Pick<InputAccessRequestParameters, "access" | "purpose"> & { requestor: string ; resource: string | URL ; status?: "all" | "denied" | "granted" }>

options?

QueryOptions & { returnLegacyJsonld?: boolean }

Returns#

Promise<DatasetWithId[]>

Deprecated

Please set returnLegacyJsonld: false and use RDFJS API

Defined in#

src/gConsent/manage/getAccessGrantAll.ts:147


getAccessGrantFromRedirectUrl#

getAccessGrantFromRedirectUrl(redirectUrl, options): Promise<DatasetWithId>

Get the Access Grant out of the incoming redirect from the Access Management app.

Parameters#

Name

Type

Description

redirectUrl

string | URL

The URL the user has been redirected to from the access management app.

options

Object

Optional properties to customise the behaviour: - fetch: an authenticated fetch function. If not provided, the default session from @inrupt/solid-client-authn-browser will be used if available.

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.returnLegacyJsonld

false

-

Returns#

Promise<DatasetWithId>

An Access Grant

Since

0.5.0

Defined in#

src/gConsent/request/getAccessGrantFromRedirectUrl.ts:39

getAccessGrantFromRedirectUrl(redirectUrl, options?): Promise<AccessGrant>

Get the Access Grant out of the incoming redirect from the Access Management app.

Parameters#

Name

Type

Description

redirectUrl

string | URL

The URL the user has been redirected to from the access management app.

options?

Object

Optional properties to customise the behaviour: - fetch: an authenticated fetch function. If not provided, the default session from @inrupt/solid-client-authn-browser will be used if available.

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.returnLegacyJsonld?

true

-

Returns#

Promise<AccessGrant>

An Access Grant

Since

0.5.0

Deprecated

Use RDFJS API

Defined in#

src/gConsent/request/getAccessGrantFromRedirectUrl.ts:55

getAccessGrantFromRedirectUrl(redirectUrl, options?): Promise<DatasetWithId>

Get the Access Grant out of the incoming redirect from the Access Management app.

Parameters#

Name

Type

Description

redirectUrl

string | URL

The URL the user has been redirected to from the access management app.

options?

Object

Optional properties to customise the behaviour: - fetch: an authenticated fetch function. If not provided, the default session from @inrupt/solid-client-authn-browser will be used if available.

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.returnLegacyJsonld?

boolean

-

Returns#

Promise<DatasetWithId>

An Access Grant

Since

0.5.0

Deprecated

Use RDFJS API

Defined in#

src/gConsent/request/getAccessGrantFromRedirectUrl.ts:71


getAccessManagementUi#

getAccessManagementUi(webId, options?): Promise<UrlString | undefined>

Get the endpoint where the user prefers to be redirected when asked for access. If the user does not specify an endpoint, this function attempts to discover the default access UI recommended by their Pod provider.

Parameters#

Name

Type

Description

webId

string | URL

The WebID of the user asked for access.

options

Pick<AccessBaseOptions, "fetch">

Optional properties to customise the access request behaviour.

Returns#

Promise<UrlString | undefined>

The URL where the user should be redirected, if discoverable.

Since

0.4.0

Defined in#

src/gConsent/discover/getAccessManagementUi.ts:114


getAccessRequest#

getAccessRequest(url, options): Promise<DatasetWithId>

Fetch the Access Request from the given URL.

Parameters#

Name

Type

Description

url

string | URL

The URL of the Access Request.

options

Object

Optional properties to customise the behaviour: - fetch: an authenticated fetch function. If not provided, the default session from @inrupt/solid-client-authn-browser will be used if available.

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.returnLegacyJsonld

false

-

Returns#

Promise<DatasetWithId>

An Access Request.

Since

2.4.0

Defined in#

src/gConsent/manage/getAccessRequest.ts:42

getAccessRequest(url, options?): Promise<AccessRequest>

Fetch the Access Request from the given URL.

Parameters#

Name

Type

Description

url

string | URL

The URL of the Access Request.

options?

Object

Optional properties to customise the behaviour: - fetch: an authenticated fetch function. If not provided, the default session from @inrupt/solid-client-authn-browser will be used if available.

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.returnLegacyJsonld?

true

-

Returns#

Promise<AccessRequest>

An Access Request.

Since

2.4.0

Deprecated

Use RDFJS API instead of relying on the JSON structure by setting returnLegacyJsonld to false

Defined in#

src/gConsent/manage/getAccessRequest.ts:57

getAccessRequest(url, options?): Promise<DatasetWithId>

Fetch the Access Request from the given URL.

Parameters#

Name

Type

Description

url

string | URL

The URL of the Access Request.

options?

Object

Optional properties to customise the behaviour: - fetch: an authenticated fetch function. If not provided, the default session from @inrupt/solid-client-authn-browser will be used if available.

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.returnLegacyJsonld?

boolean

-

Returns#

Promise<DatasetWithId>

An Access Request.

Since

2.4.0

Defined in#

src/gConsent/manage/getAccessRequest.ts:71


getAccessRequestFromRedirectUrl#

getAccessRequestFromRedirectUrl(redirectUrl, options): Promise<{ accessRequest: DatasetWithId ; requestorRedirectUrl: UrlString }>

Get the Access Request out of the incoming redirect from the Access Management app.

Parameters#

Name

Type

Description

redirectUrl

string | URL

The URL the user has been redirected to from the access management app.

options

Object

Optional properties to customise the behaviour: - fetch: an authenticated fetch function. If not provided, the default session from @inrupt/solid-client-authn-browser will be used if available.

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.returnLegacyJsonld

false

-

Returns#

Promise<{ accessRequest: DatasetWithId ; requestorRedirectUrl: UrlString }>

An Access Request, and the URL to which the corresponding grant should be sent when redirecting the resource owner back to the requestor.

Since

0.5.0

Defined in#

src/gConsent/manage/getAccessRequestFromRedirectUrl.ts:53

getAccessRequestFromRedirectUrl(redirectUrl, options?): Promise<{ accessRequest: AccessRequest ; requestorRedirectUrl: UrlString }>

Get the Access Request out of the incoming redirect from the Access Management app.

Parameters#

Name

Type

Description

redirectUrl

string | URL

The URL the user has been redirected to from the access management app.

options?

Object

Optional properties to customise the behaviour: - fetch: an authenticated fetch function. If not provided, the default session from @inrupt/solid-client-authn-browser will be used if available.

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.returnLegacyJsonld?

true

-

Returns#

Promise<{ accessRequest: AccessRequest ; requestorRedirectUrl: UrlString }>

An Access Request, and the URL to which the corresponding grant should be sent when redirecting the resource owner back to the requestor.

Since

0.5.0

Deprecated

Use RDFJS API

Defined in#

src/gConsent/manage/getAccessRequestFromRedirectUrl.ts:73

getAccessRequestFromRedirectUrl(redirectUrl, options?): Promise<{ accessRequest: DatasetWithId ; requestorRedirectUrl: UrlString }>

Get the Access Request out of the incoming redirect from the Access Management app.

Parameters#

Name

Type

Description

redirectUrl

string | URL

The URL the user has been redirected to from the access management app.

options?

Object

Optional properties to customise the behaviour: - fetch: an authenticated fetch function. If not provided, the default session from @inrupt/solid-client-authn-browser will be used if available.

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.returnLegacyJsonld?

boolean

-

Returns#

Promise<{ accessRequest: DatasetWithId ; requestorRedirectUrl: UrlString }>

An Access Request, and the URL to which the corresponding grant should be sent when redirecting the resource owner back to the requestor.

Since

0.5.0

Defined in#

src/gConsent/manage/getAccessRequestFromRedirectUrl.ts:92


issueAccessRequest#

issueAccessRequest(params, options): Promise<DatasetWithId>

Request access to a given Resource.

Parameters#

Name

Type

Description

params

InputAccessRequestParameters

Access to request.

options

AccessBaseOptions & { returnLegacyJsonld: false }

Optional properties to customize the access request behavior.

Returns#

Promise<DatasetWithId>

A signed Verifiable Credential representing the access request.

Since

0.4.0

Defined in#

src/gConsent/request/issueAccessRequest.ts:84

issueAccessRequest(params, options?): Promise<AccessRequest>

Request access to a given Resource.

Parameters#

Name

Type

Description

params

InputAccessRequestParameters

Access to request.

options?

AccessBaseOptions & { returnLegacyJsonld?: true }

Optional properties to customize the access request behavior.

Returns#

Promise<AccessRequest>

A signed Verifiable Credential representing the access request.

Since

0.4.0

Deprecated

Use RDFJS API instead of relying on the JSON structure by setting returnLegacyJsonld to false

Defined in#

src/gConsent/request/issueAccessRequest.ts:97

issueAccessRequest(params, options?): Promise<DatasetWithId>

Request access to a given Resource.

Parameters#

Name

Type

Description

params

InputAccessRequestParameters

Access to request.

options?

AccessBaseOptions & { returnLegacyJsonld?: boolean }

Optional properties to customize the access request behavior.

Returns#

Promise<DatasetWithId>

A signed Verifiable Credential representing the access request.

Since

0.4.0

Deprecated

Use RDFJS API instead of relying on the JSON structure by setting returnLegacyJsonld to false

Defined in#

src/gConsent/request/issueAccessRequest.ts:110

issueAccessRequest(params, options?): Promise<AccessRequest>

Parameters#

Name

Type

params

DeprecatedAccessRequestParameters

options?

AccessBaseOptions & { returnLegacyJsonld?: boolean }

Returns#

Promise<AccessRequest>

Deprecated

Please remove the requestor parameter.

Defined in#

src/gConsent/request/issueAccessRequest.ts:117


redirectToAccessManagementUi#

redirectToAccessManagementUi(accessRequestVc, redirectUrl, options?): Promise<void>

Redirects the application to a resource owner’s preferred access management UI.

Parameters#

Name

Type

Description

accessRequestVc

string | URL | DatasetWithId | VerifiableCredential

The VC containing the Access Request to a resource.

redirectUrl

string | URL

The URL where the user should be redirected back after having granted access.

options

RedirectToAccessManagementUiOptions

If you are in a NodeJS environment, you must specify a callback to handle the redirection.

Returns#

Promise<void>

Since

0.4.0

Defined in#

src/gConsent/discover/redirectToAccessManagementUi.ts:97


redirectToRequestor#

redirectToRequestor(accessGrantVcId, redirectUrl, options?): Promise<void>

Redirect the user to the client which requested Access to a Resource. The Access Grant is sent as part of the redirect.

Parameters#

Name

Type

Description

accessGrantVcId

string | URL

The ID of the Access Grant VC, which should be a URL

redirectUrl

string | URL

The URL where the client requesting access expects the user to be redirected

options

RedirectOptions

If you are in a NodeJS environment, you must specify a callback to handle the redirection.

Returns#

Promise<void>

A never resolving promise: the user is expected to be redirected away from the page by this call, so no code should be expected to run in that context after the redirect.

Since

0.5.0

Defined in#

src/gConsent/manage/redirectToRequestor.ts:44


revokeAccessGrant#

revokeAccessGrant(vc, options?): Promise<void>

Makes a request to the access server to revoke a given Verifiable Credential (VC).

Parameters#

Name

Type

Description

vc

string | URL | DatasetWithId | VerifiableCredential

Either a VC, or a URL to a VC, to be revoked.

options

Omit<AccessBaseOptions, "accessEndpoint">

Optional properties to customise the request behaviour.

Returns#

Promise<void>

A void promise.

Since

0.4.0

Defined in#

src/gConsent/manage/revokeAccessGrant.ts:48