Skip to content

mrkvon/css-authn

Repository files navigation

css-authn

GitHub License NPM Version NPM Type Definitions

Utilities to authenticate to Community Solid Server via its API

Supported versions are 6.x and 7.x.

This package is based on Automating authentication with Client Credentials v6 and v7.

Usage

import { v6, v7 } from 'css-authn'
// or import { createAccount, getAuthenticatedFetch } from 'css-authn/dist/7.x'

// the methods return a Promise, so you can wrap them in async function, and await them...
// get authenticated fetch
const authenticatedFetch = await v7.getAuthenticatedFetch({
  email: 'email@example',
  password: 'password',
  provider: 'https://solidserver.example',
  webId: 'https://solidserver.example/person/profile/card#me' // (optional) if there are multiple webIds associated with the account, you need to specify which one to authenticate with
  fetch, // (optional) you can also provide your own fetch compatible with native Node fetch
})

// in version 7, there's also a method to create account and pod
await v7.createAccount({
  username: 'username',
  password: 'password',
  email: 'email@example.com',
  provider: 'https://solidserver.example',
  fetch, // (optional) you can also provide your own fetch compatible with native Node fetch
})

About

Authenticate to Community Solid Server via its API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published