Socket
Socket
Sign inDemoInstall

@foundry-ai/api-auth

Package Overview
Dependencies
87
Maintainers
4
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @foundry-ai/api-auth

Foundry.ai API auth middleware


Version published
Weekly downloads
16
increased by33.33%
Maintainers
4
Install size
8.05 MB
Created
Weekly downloads
 

Readme

Source

Foundry.ai Api Auth

This module exposes connect middleware for Foundry.ai APIs to authenticate requests.

npm install --save @foundry-ai/api-auth

Basic Usage

const apiAuth = require('@foundry-ai/api-auth');
const app = require('express');

app.use(apiAuth({
  authEndpoint: 'https://auth.myapp.com/v1/oauth2/authorization'
}));

Access Data

If authorization is successful any data returned from your auth endpoint will be attached to the request and made available via req.auth

app.use(apiAuth({
  authEndpoint: 'https://auth.myapp.com/v1/oauth2/authorization'
}));

app.get('/test', (req, res, next) => {
  console.log(req.auth)
  // { 
  //   userId: 'dfce809c-9245-551d-9312-ed3551e6bebb', 
  //   scope: '*' 
  // }
})

Keywords

FAQs

Last updated on 11 Sep 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc