Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

solid-auth-tls

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solid-auth-tls

Authentication library for Solid browser-based clients

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19
increased by375%
Maintainers
2
Weekly downloads
 
Created
Source

solid-auth-tls

NPM Version Build Status Coverage Status

JS client authentication library for Solid browser-based clients. Used inside solid-client.

Usage

The solid-auth-tls client can be used from Node as well as browser processes.

Within Node

const auth = require('solid-auth-tls')

auth.login({ key: 'path/to/tls-key.pem', cert: 'path/to/tls-cert.pem' })
  .then(webId => /* ... */)
  .catch(err => /* ... */)

Within the Browser

A UMD bundle is provided so that you can do the following (after including the bundle via an HTML <script> tag):

SolidAuthTLS.login() // the browser automatically provides the client key/cert for you
  .then(webId => /* ... */)
  .catch(err => /* ... */)

You can also use a module bundler such as webpack and require the module like in the node example. When using webpack you need to include the following plugin(s) in order to keep webpack from trying to resolve node modules such as fs and https. Add this to your webpack.config.js:

const webpack = require('webpack')

module.exports = {
  // ...
  plugins: [
    new webpack.DefinePlugin({ 'global.IS_BROWSER': true })
    new webpack.optimize.UglifyJsPlugin(/* ... */)
  ]
}

This makes sure that code paths that require node modules (for use within node) become dead code and get removed by the UglifyJsPlugin's dead code eliminator.

Keywords

FAQs

Package last updated on 03 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc