![New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions](https://cdn.sanity.io/images/cgdhsj6q/production/86e6ebdea652d20da070ebbda20134b839972db7-1024x1024.webp?w=800&fit=max&auto=format)
Security News
New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
predix-uaa-client
Advanced tools
Readme
Node module to get a token from UAA using client credentials or a refresh token.
Install via npm
npm install --save predix-uaa-client
Use client credentials to get a bearer token.
NOTE: This call can be made for each outgoing request. The library will cache the token until expiry, so subsequent calls will resolve instantaneously.
const uaa_util = require('predix-uaa-client');
// Call with client credentials (UAAUrl, ClientID, ClientSecret),
// will fetch a client token using these credentials.
// In this case the client needs authorized_grant_types: client_credentials
uaa_util.getToken(url, clientId, clientSecret).then((token) => {
// Use token.access_token as a Bearer token Authroization header
// in calls to secured services.
request.get({
uri: 'https://secured.service.example.com',
headers: {
Authorization: 'Bearer ' + token.access_token
}
}).then((data) => {
console.log('Got ' + data + ' from service');
}).catch((err) => {
console.error('Error getting data', err);
});
}).catch((err) => {
console.error('Error getting token', err);
});
Use a refresh token get a new access_token for a user.
NOTE: This will NOT cache, this should only be called when a new user access token is required.
const uaa_util = require('predix-uaa-client');
// Call with client credentials (UAAUrl, ClientID, ClientSecret, RefreshToken),
// will fetch an access token for the user represented by the refresh token.
// In this case the client needs authorized_grant_types: refresh_token
uaa_util.getToken(url, clientId, clientSecret, refreshToken).then((token) => {
// New access token is in token.access_token.
// New refresh token is in token.refresh_token.
console.log('New access token', token.access_token);
console.log('New refresh token', token.refresh_token);
console.log('New access token expires at', token.expire_time);
}).catch((err) => {
console.error('Error getting token', err);
});
FAQs
Node module to get a token from UAA using client credentials or refresh tokens
The npm package predix-uaa-client receives a total of 421 weekly downloads. As such, predix-uaa-client popularity was classified as not popular.
We found that predix-uaa-client demonstrated a not healthy version release cadence and project activity because the last version was released 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
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
Security News
Results from the 2023 State of JavaScript Survey highlight key trends, including Vite's dominance, rising TypeScript adoption, and the enduring popularity of React. Discover more insights on developer preferences and technology usage.
Security News
The US Justice Department has penalized two consulting firms $11.3 million for failing to meet cybersecurity requirements on federally funded projects, emphasizing strict enforcement to protect sensitive government data.