{"id":18686,"library":"proactive-sharepoint-auth","title":"Proactive SharePoint Auth","description":"A lightweight Node.js library for authenticating against SharePoint Online and retrieving authentication cookies. Version 0.1.0 is the current stable release. It uses device-level credentials (username/password) to obtain a FedAuth cookie that can be used for subsequent SharePoint API calls. The library is minimal, with no external dependencies, but relies on the deprecated SPO login flow. It only supports username-password authentication (no MFA or app-only). Released irregularly, with no updates since initial version.","status":"maintenance","version":"0.1.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install proactive-sharepoint-auth","lang":"bash","label":"npm"},{"cmd":"yarn add proactive-sharepoint-auth","lang":"bash","label":"yarn"},{"cmd":"pnpm add proactive-sharepoint-auth","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package does not provide ES module exports. Use CommonJS require. The class is nested under `SharePoint` property.","wrong":"import { SharepointAuthenticate } from 'proactive-sharepoint-auth'","symbol":"SharePoint.Authenticate","correct":"const proactive = require('proactive-sharepoint-auth'); new proactive.SharePoint.Authenticate(...)"},{"note":"Even in TypeScript with ESM, you must use namespace import because the module exports via module.exports, not named exports.","wrong":"import { SharePoint } from 'proactive-sharepoint-auth'","symbol":"SharePoint.Authenticate","correct":"import * as proactive from 'proactive-sharepoint-auth'; new proactive.SharePoint.Authenticate(...)"},{"note":"The exported object has a 'SharePoint' property containing the Authenticate class.","wrong":"const auth = require('proactive-sharepoint-auth'); new auth.Authenticate(...)","symbol":"SharePoint.Authenticate","correct":"const { SharePoint } = require('proactive-sharepoint-auth'); new SharePoint.Authenticate(...)"}],"quickstart":{"code":"const proactive = require('proactive-sharepoint-auth');\nconst auth = new proactive.SharePoint.Authenticate(\n  'https://yourtenant.sharepoint.com',\n  'user@tenant.onmicrosoft.com',\n  'your-password'\n);\nauth.authenticate()\n  .then(cookie => {\n    console.log('Authentication cookie:', cookie);\n    // Use cookie for SharePoint API calls\n  })\n  .catch(err => {\n    console.error('Authentication failed:', err);\n  });","lang":"javascript","description":"Authenticates against SharePoint Online and logs the FedAuth cookie."},"warnings":[{"fix":"Ensure correct casing: proactive.SharePoint.Authenticate","message":"In version 0.0.1, the API was proactive.SharePoint.Authenticate instead of proactive.SharePoint.Authenticate (capitalization). Mistaking the casing will cause a runtime error.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Migrate to @pnp/nodejs or msal-node with proper OAuth 2.0 flows.","message":"Username-password authentication for SharePoint Online is deprecated by Microsoft and may stop working. Use OAuth 2.0 app-only or delegated authentication instead.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Set the cookie header as 'Cookie: FedAuth=' + cookie instead of JSON.stringify(cookie).","message":"The authenticate() method returns a cookie string, not an object. Ensure you handle it as a plain string when using in HTTP headers.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use correct require: const proactive = require('proactive-sharepoint-auth'); and access proactive.SharePoint.Authenticate.","cause":"Incorrect import or misspelling of the namespace.","error":"TypeError: proactive.SharePoint is undefined"},{"fix":"Run npm install proactive-sharepoint-auth --save","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'proactive-sharepoint-auth'"},{"fix":"Verify username/password. For MFA-enabled accounts, use an alternative auth method (e.g., app-only).","cause":"Authentication credentials are incorrect or MFA is required.","error":"Request failed with status code 403"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}