
Product
Introducing GitHub Actions Scanning Support
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
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 42 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.
Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.