All Projects → koltyakov → node-sp-auth-config

koltyakov / node-sp-auth-config

Licence: MIT license
🔧 Config options builder for node-sp-auth (SharePoint Authentication in Node.js)

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to node-sp-auth-config

sp-metadata
🔬 SharePoint Metadata Tracker
Stars: ✭ 12 (-40%)
Mutual labels:  sharepoint, sharepoint-online
Public-Samples
Public samples from speaking engagements and blog posts
Stars: ✭ 29 (+45%)
Mutual labels:  sharepoint, sharepoint-online
SP Hauler
Copy Libraries and Lists Content between ANY Version of SharePoint (SP2010/SP2013/SP2016/SPOnline).
Stars: ✭ 21 (+5%)
Mutual labels:  sharepoint, sharepoint-online
react-taxonomypicker
A Taxonomy Picker control built with TypeScript for React. Built for use in Office 365 / SharePoint
Stars: ✭ 23 (+15%)
Mutual labels:  sharepoint, sharepoint-online
sp-live-reload
SharePoint pages live reload module for client side development
Stars: ✭ 23 (+15%)
Mutual labels:  sharepoint, sharepoint-online
sprest
An easy way to develop against the SharePoint 2013/Online REST api.
Stars: ✭ 72 (+260%)
Mutual labels:  sharepoint, sharepoint-online
SpRestLib
JavaScript SharePoint REST Web Services Library
Stars: ✭ 114 (+470%)
Mutual labels:  sharepoint, sharepoint-online
O365 SPO PowerShellScripts
PowerShell scripts related to SharePoint Online in Microsoft 365
Stars: ✭ 22 (+10%)
Mutual labels:  sharepoint, sharepoint-online
pnp-starterkit-setup
x-platform setup script for the SharePoint Starter Kit
Stars: ✭ 14 (-30%)
Mutual labels:  sharepoint, sharepoint-online
gosip
⚡️ SharePoint authentication, HTTP client & fluent API wrapper for Go (Golang)
Stars: ✭ 71 (+255%)
Mutual labels:  sharepoint, sharepoint-online
sharepoint-ruby
A ruby client for Sharepoint's REST API.
Stars: ✭ 60 (+200%)
Mutual labels:  sharepoint, sharepoint-online
productivity-tools
List of popular productivity tools for SharePoint
Stars: ✭ 26 (+30%)
Mutual labels:  sharepoint, sharepoint-online
gulp-spsync
Gulp plugin for synchronizing local files with a SharePoint library
Stars: ✭ 57 (+185%)
Mutual labels:  sharepoint, sharepoint-online
SPOMod
SharePoint Module for managing lists, items and files. The module is a massive work comprising over 3000 lines of code and 50 SharePoint Online cmdlets for managing: lists list columns list items files content type taxonomy
Stars: ✭ 20 (+0%)
Mutual labels:  sharepoint, sharepoint-online
SharePoint-Security
A Github Repository Created to compliment a BSides Canberra 2018 talk on SharePoint Security.
Stars: ✭ 42 (+110%)
Mutual labels:  sharepoint, sharepoint-online
List-Formatting
List Formatting Samples for use in SharePoint and Microsoft Lists
Stars: ✭ 1,227 (+6035%)
Mutual labels:  sharepoint
sp-formatter
SharePoint formatter Chromium Edge and Google Chrome browser extension
Stars: ✭ 26 (+30%)
Mutual labels:  sharepoint
Office365dev
《Office 365 开发入门指南》,本书已经于2018年9月份由北京大学出版社上市发行,可以通过 http://product.dangdang.com/25347066.html 进行购买。配套视频教程于2019年2月在网易云课堂上架,你可以通过 https://aka.ms/office365devlesson 参加学习,教程相关的参考资料、范例代码、相关链接,请访问 https://github.com/chenxizhang/office365dev/tree/master/lessons
Stars: ✭ 228 (+1040%)
Mutual labels:  sharepoint
SharePoint-Patch-Script
An updated version of Russ Maxwell's "5 hour" SharePoint Patch Script supporting SharePoint 2013, 2016, and 2019.
Stars: ✭ 48 (+140%)
Mutual labels:  sharepoint
vbo365-rest
Unofficial Self-Service Web Portal for Veeam Backup for Microsoft Office 365
Stars: ✭ 44 (+120%)
Mutual labels:  sharepoint

node-sp-auth-config - Config options builder for node-sp-auth (SharePoint Authentication in Node.js)

NPM

npm version Downloads Actions Status FOSSA Status Gitter chat

node-sp-auth-config provides wizard-like approach for building and managing config files for node-sp-auth (Node.js to SharePoint unattended http authentication). Includes CLI for generating config files from a command prompt.

Versions supported:

  • SharePoint Online
  • SharePoint 2019
  • SharePoint 2016
  • SharePoint 2013
  • SharePoint 2010

Authentication options:

  • SharePoint Online:
    • User credentials (SAML/ADFS)
    • Add-In Only permissions
    • On-Demand authentication (using Electron popup)
  • SharePoint 2019, 2016, 2013:
    • User credentials (NTLM, NTLM v2)
    • ADFS user credentials
    • Form-based authentication (FBA)
    • Form-based authentication (Forefront TMG)
    • Add-In Only permissions
    • On-Demand authentication (using Electron popup)
  • SharePoint 2010:
    • User credentials (NTLM, NTMLv2)
    • Form-based authentication (FBA)
    • Form-based authentication (Forefront TMG)

Config layer and auth support Office 365 Dedicated (SPO on a custom domain) as well.


How to use

Install

npm install node-sp-auth-config --save

or install globally to use as CLI:

npm install node-sp-auth-config -g

Usage as CLI

sp-auth init --path ./config/private.config.json
sp-auth --help # for help about parameters

Usage in TypeScript

import { AuthConfig } from 'node-sp-auth-config';

const authConfig = new AuthConfig({
  configPath: './config/private.json',
  encryptPassword: true,
  saveConfigOnDisk: true
});

authConfig.getContext()
  .then((context) => {
    console.log(JSON.stringify(context, null, 2));
    // context.authOptions - node-sp-auth authentication options
  })
  .catch(console.warn);

Usage in JavaScript

const AuthConfig = require('node-sp-auth-config').AuthConfig;

const authConfig = new AuthConfig({
  configPath: './config/private.json',
  encryptPassword: true,
  saveConfigOnDisk: true
});

authConfig.getContext()
  .then((context) => {
    console.log(JSON.stringify(context, null, 2));
    // context.authOptions - node-sp-auth authentication options
  })
  .catch(console.warn);

Initiation parameters

Parameter Default value Description
configPath './config/private.json' Path to auth config .json
encryptPassword true Encrypt password to a machine-bind hash
saveConfigOnDisk true Save config .json to disk
forcePrompts false Force parameters prompts
headlessMode false Prevents interactive prompts - for headless, CI/CD processes
defaultConfigPath empty Path to .json config, parameters from which are placed as defaults
authOptions empty Any valid node-sp-auth options

Production runtime

Headless mode

When 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.

This can be achieved by providing headlessMode settings property is equal to true.

The headless mode also automatically configured when NODE_ENV (or SPAUTH_ENV) environment variable is equal to production.

Environment variables

All 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).

Along with credentials props these service variables are used:

Variable Description
NODE_ENV When equal to production forces headlessMode.
SPAUTH_ENV When equal to production forces headlessMode. Overwrites NODE_ENV.
SPAUTH_FORCE Makes SPAUTH_{CREDENTIALS} variables take precedence over those possibly stored in private.json.

Configuring CI/CD

Checkout this end-to-end sample.

License

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].