Socket
Socket
Sign inDemoInstall

@storyous/auth

Package Overview
Dependencies
Maintainers
7
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storyous/auth

```typescript import { createSaltAuth } from '@storyous/auth';


Version published
Weekly downloads
1
Maintainers
7
Weekly downloads
 
Created
Source

auth

Usage of saltAuth

import { createSaltAuth } from '@storyous/auth';

const config = {
    identityBaseUrl: 'https://identity.cloud.saltpay.co',
    clientId: process.env.SALTID_CLIENT_ID,
    clientSecret: process.env.SALTID_CLIENT_SECRET,
    redirectUris: ['https://login.storyous.com/api/auth/salt-id-callback'],
    customRequestTimeout: 10000
};

// see @storyous/logger
const log = initLogger(config.env, config.logging).module('saltAuth');

const saltAuth = createSaltAuth(config, log);

// During application bootstrapping,
// you have the option to set a timeout for the init function,
// allowing it to retry before throwing an error.
// If no timeout is specified, the default timeout of 30 seconds is used.
await saltAuth.init(20);

// authorize request to a service behind API Gateway
const accessToken = saltAuth.getAccessToken();
const headers = {
    'Authorization': `Bearer ${accessToken}`;
};

// get an additional OAuth client
const client = await saltAuth.createClient()

FAQs

Package last updated on 29 Apr 2024

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