@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 settingwindow.location.href
is not an option.
Since
0.4.0
Defined in#
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 |
---|---|---|
|
|
The resource for which access may be requested. |
|
Optional properties to customise the access request behaviour. |
Returns#
Promise
<UrlString
>
The URL of the access request server.
Defined in#
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 |
---|---|---|
|
|
The WebID of the user asked for access. |
|
|
Optional properties to customise the access request behaviour. |
Returns#
Promise
<UrlString
| undefined
>
The URL where the user should be redirected, if discoverable.
Defined in#
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 |
---|---|---|
|
|
The VC containing the Access Request to a resource. |
|
|
The URL where the user should be redirected back after having granted access. |
|
If you are in a NodeJS environment, you must specify a callback to handle the redirection. |
Returns#
Promise
<void
>