Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Re-usable authentication library.
npm install authwith --save
Available implementations:
OAuth2
OpenIDConnect
Note: request (req: Request) => Promise<Response>
must be provided for each implementation to support external requests (uses Servie interfaces).
import { OAuth2 } from 'authwith'
const auth = new OAuth2(options, request)
authorizationUri
The URL to redirect the user for authorizationaccessTokenUri
The URL to retrieve the access tokenprofileUri
The URL to request user informationThese are passed as the final option to each method:
clientId
The client id issued by the OAuth 2.0 serverclientSecret
The client secret issued by the OAuth 2.0 serverredirectUri
A URL on your server to receive callbacks from the OAuth 2.0 serverscope
The requested scope stringstate?
An optional state to be verified on callbackauth.getRedirectUri(params)
methodauth.getToken(uri, params)
- this will make a request and return the access tokenauth.getProfile(token, params)
- this will retrieve the users profile informationauth.refreshToken(refreshToken, params)
import { OpenIDConnect } from 'authwith'
const auth = new OpenIDConnect(options, request)
authorizationUri
The URL to redirect the user for authorizationaccessTokenUri
The URL to retrieve the access tokenissuer
The issuer string for the ID tokenExtends OAuth2
parameters:
nonce?
Verifies the nonce when reading the profile informationmaxAge?
Verifies the max age when reading the profile informationtimestamp?
Used in conjunction with maxAge
to verify auth_time
claimOpenID Connect is built on top of OAuth 2.0. Internally, it will use the id_token
instead of making a separate request for profile information.
This project is written using TypeScript and publishes the definitions directly to NPM.
Apache 2.0
FAQs
Re-usable authentication library
The npm package authwith receives a total of 2 weekly downloads. As such, authwith popularity was classified as not popular.
We found that authwith 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.