This package provides an HTTP OAuth 1.0 authentication strategy for Passport.js, enabling authentication of requests using the authorization scheme defined by the OAuth 1.0 protocol. It ships with two primary strategies: `ConsumerStrategy` for authenticating consumers (clients) based on their keys and secrets, typically used for request token and access token endpoints, and `TokenStrategy` for authenticating subsequent API requests using previously issued access tokens. Last published in February 2013, with its current stable version being 0.1.3, this module is severely outdated. It targets Node.js versions `>= 0.4.0`, rendering it incompatible with modern Node.js environments and best practices. While OAuth 1.0 was a significant advancement, it has largely been superseded by OAuth 2.0 for new application development due to OAuth 2.0's simplified implementation, its reliance on HTTPS for security, and its greater flexibility for various client types beyond traditional web applications. This module is considered abandoned and should not be used in new projects or integrated into contemporary systems.
npm install passport-http-oauthVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to configure and use `ConsumerStrategy` and `TokenStrategy` with Express and Passport.js for OAuth 1.0 authentication. It sets up mock consumer and token validation for illustrative purposes, emphasizing the distinct roles of each strategy for different OAuth 1.0 endpoints.
Migrate to a modern authentication solution, preferably using OAuth 2.0 (e.g., `passport-oauth2` or provider-specific OAuth 2.0 strategies like `passport-google-oauth20`) for new implementations. If OAuth 1.0 is strictly required, consider actively maintained alternatives or be prepared to fork and maintain the code yourself.
This package is not compatible with modern Node.js runtimes. There is no direct fix for modern Node.js; a complete replacement or substantial refactoring is necessary.
For new applications, prioritize OAuth 2.0, which is simpler to implement and generally considered more flexible and secure for a wider range of modern application architectures. Ensure all OAuth 2.0 communication occurs over HTTPS.
Do not use abandoned packages in production. Regularly audit your dependencies for known vulnerabilities using tools like `npm audit` or Snyk, and prioritize using actively maintained libraries. For authentication, always opt for well-supported and secure solutions.
Ensure `passport` is installed: `npm install passport`
Install the package: `npm install passport-http-oauth`
Use CommonJS `require()` syntax as the package does not support ES modules: `const { Strategy } = require('passport-http-oauth');`This package is incompatible with modern Node.js. It's impossible to fix this without rewriting the package's cryptographic parts to use modern Node.js crypto APIs. The only solution is to migrate to a modern, actively maintained authentication strategy or to run the application in an environment with an extremely old and insecure Node.js version, which is not recommended.