0.1.7 • Published 7 months ago

@graffiti-garden/solid-oidc-session-manager v0.1.7

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
7 months ago

Graffiti Solid OIDC Session Manager

This implements the login and logout methods of the Graffiti API using Solid OIDC.

In the browser, when an application calls graffiti.login(), a dialog opens up that allows the user to log in either locally (for demoing/testing) or with a Solid OIDC provider. The actor IDs produced from Solid login are webId URLs that start with http, while actor IDs produced from local login will not start with http.

The node.js interface is not currently implemented and just returns an instance of GraffitiLocalSessionManager, but at some point it will be extended to use @inrupt/solid-client-authn-node.

Usage

Install the package with:

npm install @graffiti-garden/solid-oidc-session-manager

Then use it in your application as follows:

import { GraffitiSolidOIDCSessionManager } from "@graffiti-garden/solid-oidc-session-manager";

const sessionManager = new GraffitiSolidOIDCSessionManager();

sessionManager.sessionEvents.addEventListener("login", (event) => {
  console.log("Logged in as", event.detail.actor);
});

// Log in, in response to a user action
button.onclick = () => sessionManager.login()

See the demo for a full example.

Development

Clone the repository, then install and build the package as follows:

npm install
npm run build

Then you can run the demo by running:

npx http-server

and navigating to localhost:8080/demo.

Image Compression

To make the .jpg image smaller, use:

cwebp -q QUALITY -m 6 -mt graffiti.jpg -o graffiti.webp

Where quality is a number between 0 (horrible) and 100 (perfect).

0.1.7

7 months ago

0.1.6

7 months ago

0.1.5

7 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

9 months ago

0.1.0

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago