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

Module: discover#

Import this module for the access API functions available to an entity discovering properties of the access API.

Type Aliases#

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/discover/redirectToAccessManagementUi.ts:54

Functions#

getAccessApiEndpoint#

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

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

Since

0.4.0

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.

Defined in#

src/discover/getAccessApiEndpoint.ts:70


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.

Since

0.4.0

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.

Defined in#

src/discover/getAccessManagementUi.ts:114


redirectToAccessManagementUi#

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

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

Since

0.4.0

Parameters#

Name

Type

Description

accessRequestVc

string | URL | 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>

Defined in#

src/discover/redirectToAccessManagementUi.ts:95