css-authn
TypeScript icon, indicating that this package has built-in type declarations

0.0.16-alpha.0 • Public • Published

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', // no trailing slash!
  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', // no trailing slash!
  fetch, // (optional) you can also provide your own fetch compatible with native Node fetch
})

Package Sidebar

Install

npm i css-authn

Weekly Downloads

6

Version

0.0.16-alpha.0

License

MIT

Unpacked Size

41.1 kB

Total Files

22

Last publish

Collaborators

  • mrkvon