
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
oauth_device_flow
Advanced tools
This is a client for using OAuth2 Device Flows in applications with limited interaction possibilities.
import { DeviceFlowClient } from "oauth_device_flow";
const app = new DeviceFlowClient({
audience: "AUDIENCE",
client_id: "CLIENT_ID",
scopes: ["openid", "offline_access"],
code_url: "DEVICE_CODE_URL",
token_url: "TOKEN_URL",
}, {
output: (str) => console.info(str)
});
// get token interactively
app
.acquireToken()
.then((token) => /* ...do stuff */);
// get token silently
app
.acquireTokenSilently()
.then((token) => /* ...do stuff */);
The client requires the following parameter:
/**
* Endpoint used to fetch tokens
* @example https://tenant.eu.auth0.com/oauth/token
*/
token_url: string;
/**
* Endpoint used to fetch the device and user code
* @example https://tenant.eu.auth0.com/oauth/device/code
*/
code_url: string;
/**
* The client ID
* You get this from your OAuth provider
*/
client_id: string;
/**
* The requested scopes
* Will automatically include "offline_access" if you set the "refreshToken" option
*/
scopes: string[];
/**
* The audience for your request
*/
audience: string;
Additionally you can provide a few other options to customize your experience and implement a cache:
/**
* Provide a cache for the token and metadata
*/
cache?: {
/**
* Deerialize the cache
*/
beforeCacheAccess: () => ClientCache;
/**
* Serialize the cache
*/
afterCacheAccess: (cache: ClientCache) => void;
};
/**
* Customize the console output
*/
output?: (str: string) => void;
/**
* Request a refresh token?
*/
refreshToken?: boolean;
FAQs
OAuth 2 Device Code Flow
We found that oauth_device_flow 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.