Skip to content

benjifs/indieauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IndieAuth

For a fully working example, checkout the serverless-indieauth repository which provides a basic working example for an IndieAuth server using Netlify functions.

Install

npm install @benjifs/indieauth

Usage

import { AuthHandler } from '@benjifs/indieauth'
const { SECRET, PASSWORD_SECRET } = process.env
export const indieauth = new AuthHandler({
  secret: SECRET,
  passwordSecret: PASSWORD_SECRET,
})

export default async (req) => indieauth.authorizationEndpoint(req)

The following variables are needed in order to create the access tokens and authenticate:

SECRET

A random generated string which will be used to create the access token. You can generate it with:

PASSWORD_SECRET

Your password hashed with bcrypt. To do so you can either:

  • htpasswd -bnBC 10 "" toomanysecrets | cut -d : -f 2 where "toomanysecrets" is the password
  • Use this website to create the hash

Supported Scopes

  • create - create posts
  • update - update existing posts
  • delete - delete posts
  • media - upload assets to your media endpoint
  • profile - share basic profile data
  • email - share your email address

References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published