
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@oslojs/oauth2
Advanced tools
Documentation: https://oauth2.oslojs.dev
A small JavaScript library for parsing OAuth 2.0 token, token revocation, and device authorization responses by Oslo.
This package follows RFC 6749, RFC 7009, and RFC 8628.
import { TokenRequestResult } from "@oslojs/oauth2";
const response = await fetch("https://github.com/login/oauth/access_token", {
method: "POST",
body,
headers
});
const data = await response.json();
if (typeof data !== "object" || data === null) {
throw new Error("Unexpected response");
}
const result = new TokenRequestResult(data);
if (result.hasErrorCode()) {
const error = result.errorCode();
throw new Error(`Request failed: ${error}`);
}
const accessToken = result.accessToken();
const accessTokenExpiresAt = result.accessTokenExpiresAt();
const refreshToken = result.refreshToken();
npm i @oslojs/oauth2
FAQs
A runtime-agnostic OAuth 2.0 library
The npm package @oslojs/oauth2 receives a total of 12,693 weekly downloads. As such, @oslojs/oauth2 popularity was classified as popular.
We found that @oslojs/oauth2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.