Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    Andrew Koltyakov
    Auth connected. Please make sure, that the auth strategy and creds are correct.
    Looks that the environment's strategy is not NTLM but something else.
    The simplest way to troubleshoot is https://github.com/koltyakov/node-sp-auth-troubleshoot
    Bruno Naibert
    I'll try that. But as I just want to get the path / URL of the images, without having to download them all, I would like to know if you have any more viable alternative? My initial plan would be to download all files in the same structure as the library and with Node.Js scan the folders and files on my computer to get only the URL / Path.
    Andrew Koltyakov
    I'd suggest PnPjs. But you have to have at least some understanding of what is SharePoint REST API.
    With REST, obviously, you can request a list/library and get metadata, filter only images, etc.
    Hello, I am getting this error
    Access to XMLHttpRequest at 'https://waconafd.officeapps.live.com/apc/trans.gif?b320ab775852cec633df8395c6a55814' from origin 'https://abcd.sharepoint.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    2 replies
    I am looking to authenticate with a smart card. I was wondering if that is possible?
    1 reply
    Clint Lechner
    @koltyakov I've been meaning to say something for a while, it looks like you have react listed twice in your default app.json. I assume one should be a dev version but they are both prod. Same path...
    Andrew Koltyakov
    @clechner77 thanks! It's a bug with presets. Fixed, will publish an update shortly.
    Hi, anyone managed to authenticate with MFA? I get "Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access"
    Miguel Ángel González Muñoz
    Hi, everyone, I have a problem with read permissions users in a site collection, I have tested and they can update his/her information in User Information List, using script, that is to say, they can change their email and their DisplayName/Title. Anyone know what's wrong or how to solve it?
    The script returns not authorized, but it updates the info: Even if the response from the request is a 403 not authorized:
    {"error":{"code":"-2147024891, System.UnauthorizedAccessException".....}

    Here you have the script in case you want to test it from chrome: var reqUrl= "https://XXXX.sharepoint.com/_api/web/siteusers/getbyid(170)";
    var body={ '__metadata':{ 'type': 'SP.Data.UserInfoItem' }, 'Title':'Active3','EMail': 'xxxx@xxx.es' }
    var _payloadOptions = {
    method: "POST",
    body: undefined,
    headers: {
    credentials: "include",
    Accept: "application/json; odata=verbose",
    "Content-Type": "application/json; odata=verbose"

    //Get RequestDigest First
    // Make REST API Call to update list item without increamenting version.


    Hi everyone, I used the "sppull" NPM package to download files from Sharepoint. But when the file is downloaded and I try to open it throw me an error:
    Does anyone have the same error or any solution?
    Andrew Koltyakov
    Hi @HeinnerXD, responded to the issue on GitHub. Let's continue from there.
    Hi @koltyakov I was facing an issue trying to use the sppull api you provided (https://github.com/koltyakov/sppull) to download a shared excel file
    I followed the example as you showed:
    with this response:
    Folders proceeding: 0 out of 0 [recursive scanning...]Core error has happened Error: Invalid argument
    also tried to specify the file:
    with these response:
    Downloading files: 1 out of 1
    Error in operations.downloadFile: Invalid argument
    could you please help on this? don't know what I'm doing wrong here
    Andrew Koltyakov

    Hey @DardoJav,

    Please try with auth configurator to avoid incorrect creds payload:

    import { AuthConfig as SPAuthConfigurator } from 'node-sp-auth-config';
    import { ISPPullOptions, ISPPullContext, Download as IDownload } from 'sppull';
    new SPAuthConfigurator().getContext().then((context) => {
      const Download: IDownload = require('sppull');
      const sppull = Download.sppull;
      const context: ISPPullContext = {
        siteUrl: context.siteUrl,
      } as any;
      const options: ISPPullOptions = {
        spRootFolder: 'Shared%20Documents',
        dlRootFolder: './Downloads/Documents'
      sppull(context, options);
    Mohammed Abbod
    Hi, I have angular SPFx in SP2019 responsible to show MegaMenu's and listing all sites/subsites using this REST API : /_api/web/getsubwebsfilteredforcurrentuser(nwebtemplatefilter=-1,nconfigurationfilter=0), also its working now in [my company].sharepoint.com in cloud, there is one SSO PingFederate controlling the authentication in both environment. is there a library like msal.js be able to talk from one environment to another one using the token that user issued when logged in ? Thanks in advance.
    Hi, I am facing issue -
    spauth.getAuth is working fine while I am using with http server but it gives error while using with express node server.
    Error is - enrufused to connect 443 port

    This works for me:

    const { AuthConfig } = require('node-sp-auth-config');
    const { create } = require('sp-request');
    (async () => {
      const { siteUrl, authOptions } = await new AuthConfig().getContext();
      const spr = create(authOptions);
      const digest = await spr.requestDigest(`${siteUrl}`);
      const res = await spr.post(`${siteUrl}/_api/web/lists/getByTitle('MyList')/items(1)`, {
        headers: {
          'X-RequestDigest': digest,
          'X-HTTP-Method': 'DELETE',
          'IF-MATCH': '*'
      console.log(res.statusCode, res.statusMessage);

    ok, so I have an issue with this code - and it must be a config setting. If I run this, I get prompted for all my dettails (url, type, username etc)
    however, I get a 401

    if I browse to the site in chrome, and enter the same username, password I get logged on

    what am I missing ? I really would appreciate some help here, my eyes are bleeding from all the googling ;)

    1 reply
    I'm trying to use User credentials (NTLM) btw
    Hi! Is there an easy way to create a react CEWP that im not seeing? I don't know how to use webpack because i normally use create-react-app . I selected the option to use react but it doesn't look like that did anything?
    do I have to create a new webpack config from scratch and find all the related babel plugins to install?
    Danny Foncke
    CEWP as in Content Editor Web Part on classic SharePoint? In that case, build your react app, copy the content of the dist folder to an SP library, point your CEWP to the html. Done
    Danny Foncke
    @utahisnotastate CEWP as in Content Editor Web Part on classic SharePoint? In that case, build your react app, copy the content of the dist folder to an SP library, point your CEWP to the html. Done
    Andrew Koltyakov
    @utahisnotastate check generator-sppp, it covers this scenario right out of the box without any additional configuration.
    @koltyakov OK so i'm a huge moron. Apparently you are supposed to hit space bar when the genererator asks you if you want react. I hit enter and I guess it assumed i didnt want either of those. That's what the issue was
    and yeah, you can do a lot with CEWP still

    @koltyakov I got this error. My project wants to download the excel file and read it, but at some point it does not work and the account is error , This excel file I was shared by a member of the company, please help me :

    (node:20972) UnhandledPromiseRejectionWarning: Error: <S:Fault>
    <S:Text xml:lang="en-US">Authentication Failure</S:Text>
    <psf:error xmlns:psf="http://schemas.microsoft.com/Passport/SoapServices/SOAPFault">
    <psf:text>AADSTS50076: Due to a configuration change made by your administrator, or because you moved t
    o a new location, you must use multi-factor authentication to access ''.</psf:text>
    at OnlineUserCredentials.postToken (C:\Users\MEDCPham\Documents\CloneServer\node_modules\node-sp-auth\lib\s
    at C:\Users\MEDCPham\Documents\CloneServer\node_modules\node-sp-auth\lib\src\auth\resolvers\OnlineUserCrede
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    (Use node --trace-warnings ... to show where the warning was created)
    (node:20972) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by thr
    owing inside of an async function without a catch block, or by rejecting a promise which was not handled with .
    catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections =strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
    (node:20972) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise
    rejections that are not handled will terminate the Node.js process with a non-zero exit code.

    My Code :

    function getExcelData() {
    spauth.getAuth(url, {

         var headers = options.headers;  
        headers['Accept'] = "application/json;odata=verbose";  
         url: url,   
             headers: headers,  
           encoding: null
            fs.writeFile('./public/excel.xlsx', listresponse , 'binary', function(err){
                if (err) console.log(err) 
                var today = new Date();
                var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
                console.log('File saved.')

    // function logic

    sorry im just some random dude but on this link it says you need a domain property. I dont know anything about what the domain property is supposed to be
    username: 'administrator',
    password: '[password]',
    domain: 'sp'
    you only have username and password
    all you are doing is download a excel sheet from a document library?
    why not just link to the sheet and SP should download it automatically to the computer
    the other thing is that the error message says that MFA is required
    also, you dont have the requestprom() function defined in that code you linked, but the API method in that example is request.get()
    also, try putting a catch() inbetween the two .then()s just saying .catch(error => console.log(error)) and also put that after the last .then() as well
    here is some thread i found
    Hi there, is anyone available?