by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jorge Sepulveda
    @jorluiseptor
    Hello. I have a noob question. I just started using sp-rest-proxy. I have my local dev running on localhost:3000 and the proxy on localhost:3001. I still get a 403. The proxy is supposed to run on a separate port, right?
    Sergei Sergeev
    @s-KaiNet
    right
    do you see any other errors in console?
    Jorge Sepulveda
    @jorluiseptor
    the proxy by itself works fine, e.g. if i copy an api url, i get data. but the homepage gives me an error: Error: ENOENT: no such file or directory, open 'C:\Users\jorlu\Projects\StaffAvailibilityTool\sat.ux\static\index.html'
    in the console i get: GET http://localhost:3001/_api/web/getuserbyid(10) 403 (Forbidden)
    Sergei Sergeev
    @s-KaiNet
    try to run your proxy on https, I use below code to run it on https with the save certificated used by SPFx:
    const CertStore = require('@microsoft/gulp-core-build-serve/lib/CertificateStore');
    const RestProxy = require('sp-rest-proxy');
    
    const CertificateStore = CertStore.CertificateStore || CertificateStore.default;
    
    const settings = {
      configPath: './config/private.json',
      port: 4323,
      protocol: 'https',
      ssl: {
        cert: CertificateStore.instance.certificateData,
        key: CertificateStore.instance.keyData
      }
    };
    
    const restProxy = new RestProxy(settings);
    restProxy.serve();
    to make it work you should have SPFx solution installed in your folder with proxy.js file
    Jorge Sepulveda
    @jorluiseptor
    got it. let me take a look
    Jorge Sepulveda
    @jorluiseptor
    thank, @s-KaiNet . That was the issue. I needed to create a local https. ty for your time.
    Danny Foncke
    @dannyfoncke

    hi
    New here, so excuse if I tackle asking this question the wrong way

    I have a node js app running on a server that connects to SharePoint using adfs (node-sp-auth)
    Works like a charm

    Porting this app to a new env, the admins of that env tell me to 'include the (url of the) identity provider to be used for authentication' ....

    Right. ??

    Don't know if my question makes sense, but all help is greatly appreciated

    Sergei Sergeev
    @s-KaiNet
    tbh I don't have an idea what they are asking :)
    if you can ask them to explain, it might be helpful
    Danny Foncke
    @dannyfoncke

    When I go to a SP site via the browser I get a (logon) screen, which asks me to choose the place (identity provider ?) where my credentials are kept.
    After choosing that I can give my credentials
    My node app has no knowledge of this 'choosing an identity provider' so the authentication fails ? because the receiving end does not know where to validate ?
    Hence the admins ask me to 'include the identity provider in my call

    That's what I make of it anyway

    I found passport-saml ....
    Danny Foncke
    @dannyfoncke
    looks way more complicated
    Sergei Sergeev
    @s-KaiNet
    if one of those identity providers is adfs provider, then it should just work. The only thing is that you should correctly setup credentials options for adfs (like relyingParty, etc)
    Denis Molodtsov
    @Zerg00s
    hi there, does anyone know if it's possible to run o365 cli from inside a gulp task? Sorry if it's a wrong place for a question like that
    Andrew Koltyakov
    @koltyakov
    Hi @Zerg00s you can literally run any non interactive command line tool in Node.js and Gulp tasks in particular. There are some nuances as usual but totally feasible. For Gulp, take a look at this library https://www.npmjs.com/package/gulp-shell, hope this will help.
    Andrew Koltyakov
    @koltyakov
    Didn’t try O365 CLI as a library (use it only as a CLI), however, it should also be possible reusing some parts by importing them into a Node.js project too. Interesting idea to check.
    Denis Molodtsov
    @Zerg00s
    Thank you @koltyakov (Andrew) Looks like exactly what I was looking for
    Tim Parsons
    @timmparsons
    Hi All, I'm new to sharepoint and am wondering how I go about posting to a list from data i'm receiving in a webhook?
    Andrew Koltyakov
    @koltyakov
    Hi @timmparsons, webhooks return only context metadata and change token. Using change token and request to getlistitemchangessincetoken API endpoint (see more: https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/synchronize-sharepoint-items-using-the-rest-service) the actual changes can be recived.
    There is a variety of ways to consume SP API: PnPjs, sp-request, raw fetch + node-sp-auth powered, to name just a few.
    AnotherGenericJim
    @AnotherGenericJim
    Hey everyone I am in an odd situation where I am on a SP 2013 on premise install with no app model turned on. I was hoping the node-sp-auth library might help with getting authorization for cross domain calls for localhost 3000 (not sure if it can accomplish this or not) as part of a react project in vs code. That being said I am also getting odd issues when I install that library. For instance it says readline is missing and when I try and change the path it then throws path binding errors. Was anyone able to get this library to work? If so will it solve for what I am attempting to do?
    this is the library I am referring to : https://www.npmjs.com/package/node-sp-auth
    Sergei Sergeev
    @s-KaiNet
    node-sp-auth is a module for nodejs, it can't be used in react application
    AnotherGenericJim
    @AnotherGenericJim
    I see
    I am pretty new to this whole js programming thing Sergei so I apologize if this dumb question. Isnt NodeJS just a bunch of libraries? What prevents it from being used with a react app? Again this is probably just an ignorance issue on my part. Thanks for being so quick to reply to my question.
    Sergei Sergeev
    @s-KaiNet
    no worries, that's the reason we have this chat - for the whole range of questions
    nodejs is an "environment" to run javascript on a server (i.e. in your operation system process), like .NET but for javascript
    when you run react app, it runs inside your browser, which is different from nodejs
    node-sp-auth uses some things from the underlying operation system, thus making it impossible to run in-browser (in react app for example)
    AnotherGenericJim
    @AnotherGenericJim
    Got it and a big thank you for the explanation. So what would I do to send a simple fetch call to Sharepoint 2013 with regards to cross domain rest calls? I saw that it uses a cookies to help with authentication but I am unsure how to approach grabbing it. I have tried just username, password, and domain in headers and that doesn't seem to get be passed a simple 401 and the no cross domain error. If you had a minute how would you potentially approach a scenario like this one? Again, I truly appreciate your insight and help.
    that get me passed not get be passed. Sorry about the typo.
    Sergei Sergeev
    @s-KaiNet
    just to be clear - you want to access SharePoint via rest api from your app running at localhost:3000, correct?
    AnotherGenericJim
    @AnotherGenericJim
    Yes Sergei that is what I am attempting.
    Sergei Sergeev
    @s-KaiNet

    tbh that's not a trivial question, it depends on type of authentication used by your SharePoint instance you're trying to reach out
    one option would be implementing the same type of authentication in your app, then enabling cors in SharePoint 2013 to be able to send cors request from one domain (your app) to SharePoint
    another option use server-side code with any kind of authentication (username and password) and perform all kind of operation from server
    the last option is provider-hosted app

    you can try to post your question on a forum https://sharepoint.stackexchange.com or https://techcommunity.microsoft.com/t5/SharePoint/bd-p/SharePoint_General

    AnotherGenericJim
    @AnotherGenericJim
    Ok I appreciate the help Sergei. Thanks!
    Andrew Koltyakov
    @koltyakov
    @AnotherGenericJim, localhost:3000 - so it's only during development time in CRA serve mode?
    did you try sp-rest-proxy? a bit old article yet shows the idea https://www.linkedin.com/pulse/getting-started-react-local-development-sharepoint-andrew-koltyakov/
    AnotherGenericJim
    @AnotherGenericJim
    Andrew Thanks for sharing I will on board that and give it a try. Appreciate you sharing.
    peni4142
    @peni4142
    Hi this is my second try for Gitter :) I using spsave for uploading to Sharepoint (O365). It returns Statuscode Error 500 (Internal Server Error). Does spsave create folders, if they don't exists?
    peni4142
    @peni4142
    Ok folder seems not to be the problem at all. Tried to upload into an existing folder
    peni4142
    @peni4142
    I getting following error: "500 - {"error":{"code":"-1, Microsoft.SharePoint.Client.UnknownError","message":{"lang":"de-DE","value":"Unbekannter Fehler."}}}", but I have no idea why
    Sergei Sergeev
    @s-KaiNet
    @peni4142 which kind of authentication do you use? username and password?
    I would suggest trying client id and client secret (aka add-in auth)
    use this wiki page to find out how to configure it https://github.com/s-KaiNet/node-sp-auth/wiki/SharePoint-Online-addin-only-authentication
    peni4142
    @peni4142
    using username and password at the moment.
    but maybe I have a problem with sharepoint, what is site, what is a folder. I am very new to sharepoint :D
    Sergei Sergeev
    @s-KaiNet
    Sometimes tenants admins disable auth with username and password, it might be the reason why it fails
    peni4142
    @peni4142
    I think authenfication is not that problem. I had already used bad password and get the error message, not authenficated
    yeah it works. I had a problem with understanding what is a folder and what is a site :D sorry for bothering you
    Andrew Koltyakov
    @koltyakov
    If it's SharePoint Online, custom script can be disabled by default. In case of custom scripts even being a site collection admin you are blocked in uploading a single JS/CSS, etc. Check this for details https://www.koskila.net/how-to-enable-custom-scripts-for-a-sharepoint-online-site-collection/
    peni4142
    @peni4142
    If I try to upload a file into a library (which contains folder) or set the "root"folder to a not existing entry of the library, I don't get an error, but I can't seet it in SharePoint
    Sergei Sergeev
    @s-KaiNet
    You should create a library with corresponding name first, SharePoint UI doesn't show all folders