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

@blackbaud/auth-client

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blackbaud/auth-client

Provides methods for obtaining an authentication token from the Blackbaud authentication service.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
74
decreased by-66.06%
Maintainers
1
Weekly downloads
 
Created
Source

@blackbaud/auth-client

Provides a client-side library for interacting with Blackbaud authentication.

Installation

  • Ensure that you have Node v6+ and NPM v3+. To verify this, run node -v and npm -v at the command line.
  • For Mac OS X, we recommend that you use Node Version Manager (nvm) to wrap your NodeJS installation so that it installs in your user directory and avoids permission-related issues.
  • From the command line, run npm install blackbaud/auth-client -g (Note the lack of @ at the beginning of the package name. This is because auth client has not yet been registered with NPM).

Usage

Standalone (ES6/TypeScript)

There are two classes available in this package: BBAuth and BBOmnibar. BBAuth allows you to retrieve an auth token from the Blackbaud authentication service, and BBOmnibar allows you to render the omnibar at the top of the page.

You can use these in combination to integrate your application with Blackbaud authentication.

import { BBAuth, BBOmnibar } from '@blackbaud/auth-client';

// Make an initial attempt to get an auth token.  If the user is not currently logged in,
// this code will redirect the browser to Blackbaud's sign-in page.
BBAuth.getToken()
  .then(() => {
    // The user is logged in; load the omnibar.
    BBOmnibar.load({
      serviceName: 'Some service name'
    });

    // Add additional logic to bootstrap the rest of the application.
  });

To make authorized requests to your web service endpoints you will also use the BBAuth.getToken() method to retrieve a token that can be added as a header to your request. Since retrieving a token is an asynchronous operation, this method returns a Promise, so you should wait until the Promise is resolved before making your web request.

import { BBAuth } from '@blackbaud/auth-client';

BBAuth.getToken()
  .then((token: string) => {
    const xhr = new XMLHttpRequest();

    xhr.open('GET', url, true);

    xhr.setRequestHeader('Authorization', 'Bearer ' + token);

    xhr.send();
  });

FAQs

Package last updated on 11 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