
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
dnt-connect
Advanced tools
Node.JS library for DNT's single sign on service – DNT Connect. This README explains the technical implemetation of using DNT Connect in your Node application. For detaials on data returned through the API and various response codes see this document. Please contact opensource@turistforneingen.no if you are interested in using DNT Connect for your application in order to get an API key.
Require Node.JS version >= 0.10
.
npm install dnt-connect --save
var Connect = require('dnt-connect');
var client = new Connect('myClientName', 'myBase64EncodedSecretKey');
Imortant! The key should be a base64
representation of your secret key in
order for the dnt-connect
package to decrypt the response from DNT Connect
properly.
Bounce is used to check if a user is currently authenticated with DNT Connect.
The bounce url will bounce the user automaticly back to the provided
redirect_url
with user data if the user is authenticated.
var url = client.bounce('http://mysite.com/auth')
Signon is used to require a user to sign in with their DNT Connect user or
register a new user. The user credentials will be sent to the redirect_url
when the users is sucessfully authenticated.
var url = client.signon('http://mysite.com/auth')
For your convenience we have provided a fully compatible Express.js middeware
tha can bounce
or do a full signon
of your users. A full example can be
found in
here.
app.get('/connect', connect.middleware('signon'), function getAuth(req, res) {
if (req.dntConnect.err) {
res.status(500).json({error: err.message});
} else {
res.status(200).json({data: req.dntConnect.data});
}
});
All data sent and recieved to and from DNT Connect is encrypted by 256 bit AES
cipher in CBC mode. In order to read recieved data from DNT Connect your
application needs to call #decrypt()
wich will use your privat DNT Connect API
key to decrypt and verify the data.
NB
The return from the #decrypt() method is an Array
with two elements in
it; data
and valid
. The reason for this is because of Destructing
assignments,
new in ECMAScript 6.
try {
var data = client.decrypt({data: queryData, hmac: queryHmac});
if (data[1] === false) {
console.log('Validation failed');
} else {
console.log('Decrypted data');
console.log(data[0]);
}
} catch (e) {
// Decryption or serialization failed
}
FAQs
Node.JS library for DNT's single sign on service DNT Connect
The npm package dnt-connect receives a total of 7 weekly downloads. As such, dnt-connect popularity was classified as not popular.
We found that dnt-connect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.