Skip to content
This repository was archived by the owner on Mar 2, 2026. It is now read-only.

graffiti-garden/solid-oidc-session-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecated!

Graffiti no longer uses Solid, so this package is no longer maintained. See the up-to-date Graffiti client/server pair here:

What follows is kept for archival purposes:

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).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors