| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This library verifies Solid OIDC access tokens via their webid claim, and thus asserts ownership of a WebID.
It conforms to the Solid OIDC specification.
See also: Solid OIDC Primer Request Flow
Verify Solid Access Tokens with a simple function:
import type { RequestMethod, SolidTokenVerifierFunction } from '@solid/access-token-verifier';
import { createSolidTokenVerifier } from '@solid/access-token-verifier';
const solidOidcAccessTokenVerifier: SolidTokenVerifierFunction = createSolidTokenVerifier();
try {
const { client_id: clientId, webid: webId } = await solidOidcAccessTokenVerifier(
authorizationHeader as string,
{
header: dpopHeader as string,
method: requestMethod as RequestMethod,
url: requestURL as string
}
);
console.log(`Verified Access Token via WebID: ${webId} and for client: ${clientId}`);
return { webId, clientId };
} catch (error: unknown) {
const message = `Error verifying Access Token via WebID: ${(error as Error).message}`;
console.log(message);
throw new Error(message);
}The solidOidcAccessTokenVerifier function takes an authorization header which can be an encoded Bearer or DPoP bound access token and optional DPoP parameters.
| Back | FazBrowse Home | New Git URL |