{"id":21655882,"url":"https://github.com/koltyakov/node-sp-auth-config","last_synced_at":"2025-07-18T06:36:02.699Z","repository":{"id":20742729,"uuid":"90735229","full_name":"koltyakov/node-sp-auth-config","owner":"koltyakov","description":"🔧 Config options builder for node-sp-auth (SharePoint Authentication in Node.js)","archived":false,"fork":false,"pushed_at":"2023-02-03T08:51:17.000Z","size":553,"stargazers_count":20,"open_issues_count":7,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-02T22:37:42.900Z","etag":null,"topics":["authentication","cli","javascript","node-sp-auth","nodejs","sharepoint","sharepoint-online","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koltyakov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-09T10:51:38.000Z","updated_at":"2022-08-30T19:21:11.000Z","dependencies_parsed_at":"2024-06-18T15:23:35.566Z","dependency_job_id":"a34dcac6-3818-40f1-9961-5a1bb80a8d03","html_url":"https://github.com/koltyakov/node-sp-auth-config","commit_stats":{"total_commits":145,"total_committers":6,"mean_commits":"24.166666666666668","dds":0.6620689655172414,"last_synced_commit":"f5c40e1158595c9968c6afecb6c0640213c2bf5a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/koltyakov/node-sp-auth-config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koltyakov%2Fnode-sp-auth-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koltyakov%2Fnode-sp-auth-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koltyakov%2Fnode-sp-auth-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koltyakov%2Fnode-sp-auth-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koltyakov","download_url":"https://codeload.github.com/koltyakov/node-sp-auth-config/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koltyakov%2Fnode-sp-auth-config/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265711115,"owners_count":23815472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","cli","javascript","node-sp-auth","nodejs","sharepoint","sharepoint-online","typescript"],"created_at":"2024-11-25T08:37:35.777Z","updated_at":"2025-07-18T06:36:02.673Z","avatar_url":"https://github.com/koltyakov.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-sp-auth-config - Config options builder for node-sp-auth (SharePoint Authentication in Node.js)\n\n[![NPM](https://nodei.co/npm/node-sp-auth-config.png?mini=true\u0026downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/node-sp-auth-config/)\n\n[![npm version](https://badge.fury.io/js/node-sp-auth-config.svg)](https://badge.fury.io/js/node-sp-auth-config)\n[![Downloads](https://img.shields.io/npm/dm/node-sp-auth-config.svg)](https://www.npmjs.com/package/node-sp-auth-config)\n[![Actions Status](https://github.com/koltyakov/node-sp-auth-config/workflows/Node%20CI/badge.svg)](https://github.com/koltyakov/node-sp-auth-config/actions)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fkoltyakov%2Fnode-sp-auth-config.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkoltyakov%2Fnode-sp-auth-config?ref=badge_shield)\n[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/sharepoint-node/Lobby)\n\n`node-sp-auth-config` provides wizard-like approach for building and managing config files for [node-sp-auth](https://github.com/s-KaiNet/node-sp-auth) (Node.js to SharePoint unattended http authentication). Includes CLI for generating config files from a command prompt.\n\n**Versions supported**:\n\n- SharePoint Online\n- SharePoint 2019\n- SharePoint 2016\n- SharePoint 2013\n- SharePoint 2010\n\n**Authentication options**:\n\n- SharePoint Online:\n  - User credentials (SAML/ADFS)\n  - Add-In Only permissions\n  - On-Demand authentication (using Electron popup)\n- SharePoint 2019, 2016, 2013:\n  - User credentials (NTLM, NTLM v2)\n  - ADFS user credentials\n  - Form-based authentication (FBA)\n  - Form-based authentication (Forefront TMG)\n  - Add-In Only permissions\n  - On-Demand authentication (using Electron popup)\n- SharePoint 2010:\n  - User credentials (NTLM, NTMLv2)\n  - Form-based authentication (FBA)\n  - Form-based authentication (Forefront TMG)\n\nConfig layer and auth support Office 365 Dedicated (SPO on a custom domain) as well.\n\n---\n\n## How to use\n\n### Install\n\n```bash\nnpm install node-sp-auth-config --save\n```\n\nor install globally to use as CLI:\n\n```bash\nnpm install node-sp-auth-config -g\n```\n\n### Usage as CLI\n\n```bash\nsp-auth init --path ./config/private.config.json\nsp-auth --help # for help about parameters\n```\n\n### Usage in TypeScript\n\n```javascript\nimport { AuthConfig } from 'node-sp-auth-config';\n\nconst authConfig = new AuthConfig({\n  configPath: './config/private.json',\n  encryptPassword: true,\n  saveConfigOnDisk: true\n});\n\nauthConfig.getContext()\n  .then((context) =\u003e {\n    console.log(JSON.stringify(context, null, 2));\n    // context.authOptions - node-sp-auth authentication options\n  })\n  .catch(console.warn);\n```\n\n### Usage in JavaScript\n\n```javascript\nconst AuthConfig = require('node-sp-auth-config').AuthConfig;\n\nconst authConfig = new AuthConfig({\n  configPath: './config/private.json',\n  encryptPassword: true,\n  saveConfigOnDisk: true\n});\n\nauthConfig.getContext()\n  .then((context) =\u003e {\n    console.log(JSON.stringify(context, null, 2));\n    // context.authOptions - node-sp-auth authentication options\n  })\n  .catch(console.warn);\n```\n\n#### Initiation parameters\n\n| Parameter | Default value | Description |\n| --- | --- | --- |\n| configPath | '`./config/private.json`' | Path to auth config `.json` |\n| encryptPassword | `true` | Encrypt password to a machine-bind hash |\n| saveConfigOnDisk | `true` | Save config `.json` to disk |\n| forcePrompts | `false` | Force parameters prompts |\n| headlessMode | `false` | Prevents interactive prompts - for headless, CI/CD processes |\n| defaultConfigPath | empty | Path to `.json` config, parameters from which are placed as defaults |\n| authOptions | empty | Any valid `node-sp-auth` options |\n\n### Production runtime\n\n#### Headless mode\n\nWhen using in a headless mode, in case of missing parameters, one can expect non-interactive behavior with no prompts but graceful exit with corresponding error output.\n\nThis can be achieved by providing `headlessMode` settings property is equal to `true`.\n\nThe headless mode also automatically configured when `NODE_ENV` (or `SPAUTH_ENV`) environment variable is equal to `production`.\n\n#### Environment variables\n\nAll the parameters which are usually stored in `private.json` can be defined also using environment variables. Environment variables started with `SPAUTH_` prefix are recognized with the library. The second part of the name is an actual name of the `node-sp-auth` credentials property yet in uppercase (e.g. `SPAUTH_SITEURL`, `SPAUTH_USERNAME`, `SPAUTH_PASSWORD`).\n\nAlong with credentials props these service variables are used:\n\n| Variable | Description |\n| --- | --- |\n| `NODE_ENV` | When equal to `production` forces `headlessMode`. |\n| `SPAUTH_ENV` | When equal to `production` forces `headlessMode`. Overwrites `NODE_ENV`. |\n| `SPAUTH_FORCE` | Makes `SPAUTH_{CREDENTIALS}` variables take precedence over those possibly stored in `private.json`. |\n\n## Configuring CI/CD\n\nCheckout [this end-to-end sample](https://github.com/koltyakov/sppp-cicd-sample).\n\n## License\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fkoltyakov%2Fnode-sp-auth-config.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkoltyakov%2Fnode-sp-auth-config?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoltyakov%2Fnode-sp-auth-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoltyakov%2Fnode-sp-auth-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoltyakov%2Fnode-sp-auth-config/lists"}