![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@blackbaud/auth-client
Advanced tools
Provides methods for obtaining an authentication token from the Blackbaud authentication service.
Provides a client-side library for interacting with Blackbaud authentication.
node -v
and npm -v
at the command line.npm install @blackbaud/auth-client --save
in your project's folder.The auth client library makes extensive use of ES6-style Promises, so in order to support browsers that do not yet have native support for Promises (such as Internet Explorer 11) you will need to include a Promise polyfill such as es6-promise
and use the auto-polyfill feature of the library so that Promise
is added to the global environment. This will need to be loaded on your page before the auth client library.
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();
});
Auth client is also distributed as a UMD bundle. If you're using ES5 with Node or a tool like Browserify you can require()
it:
var BBAuthClient = require('@blackbaud/auth-client');
BBAuthClient.BBOmnibar.load({
serviceName: 'Some service name'
});
If you're not using a module loader or prefer to reference the file via CDN, you can load the file onto your page via <script>
tag.
If using NPM, add a reference to dist/bundles/auth-client.umd.js
or concatenate that file with the rest of your page's JavaScript.
If using the SKY UX CDN, add a reference to https://sky.blackbaudcdn.net/static/auth-client/[VERSION]/auth-client.global.min.js
, where [VERSION]
is the version you'd like to use. All versions published to NPM are also available through the CDN. You can also reference the latest major version. Example versions:
https://sky.blackbaudcdn.net/static/auth-client/2.24.0/auth-client.global.min.js
https://sky.blackbaudcdn.net/static/auth-client/2/auth-client.global.min.js
You can now access it via the global BBAuthClient
variable:
// BBAuthClient is global here.
BBAuthClient.BBOmnibar.load({
serviceName: 'Some service name'
});
FAQs
Provides methods for obtaining an authentication token from the Blackbaud authentication service.
The npm package @blackbaud/auth-client receives a total of 166 weekly downloads. As such, @blackbaud/auth-client popularity was classified as not popular.
We found that @blackbaud/auth-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.