Giter Club home page Giter Club logo

Comments (17)

dinogit avatar dinogit commented on June 3, 2024 1

Hi @koltyakov

I have test it and it's not working, receiving sam error.

Thank you very much for your time tonight and looking forward to see progress with environment behind TMG.

from sp-rest-proxy.

s-KaiNet avatar s-KaiNet commented on June 3, 2024 1

The only option which might work is ondemand scenario.
At least it works for this configuration, so that's a big chance it will work for TMG.
@dinogit have you tried on-demand option?

from sp-rest-proxy.

koltyakov avatar koltyakov commented on June 3, 2024 1

Hey guys,

I've figured out and implemented new auth strategy for SharePoint (or actually any website) behind Forefront TMG reverse proxy.

Created a PR s-KaiNet/node-sp-auth#17 to node-sp-auth project, hope the merge process will be smooth.

from sp-rest-proxy.

dinogit avatar dinogit commented on June 3, 2024 1

Hi @koltyakov I have updated yarn and it's working

from sp-rest-proxy.

koltyakov avatar koltyakov commented on June 3, 2024

Hi there @dinogit,

Can you try using relative URLs starting with '/'?
E.g. '/_api/web' not '_api/web'.

from sp-rest-proxy.

dinogit avatar dinogit commented on June 3, 2024

Hi @koltyakov

tried that first, it didn't work

image

How can I check if authentication succeeded?

from sp-rest-proxy.

koltyakov avatar koltyakov commented on June 3, 2024

I've just checked _api and /_api both works for me, I even forgot that this was taken into account. =)

You can check if auth works by creating authCheck.js in project's root folder with:

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

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

authConfig.getContext()
    .then(context => {
        return spauth.getAuth(context.siteUrl, context.authOptions);
    })
    .then(options => {
        console.log(options);
    })
    .catch(error => {
        console.log(error);
    });

and running:

node ./authCheck

If auth is ok, then there should be something like this:

image

or an error if something wrong with the creds or network or something. E.g.:

image

from sp-rest-proxy.

koltyakov avatar koltyakov commented on June 3, 2024

What auth type are you using, what is the version of SharePoint?
I can see that it's on-premises, some auth could have been provided wrong.

from sp-rest-proxy.

dinogit avatar dinogit commented on June 3, 2024

hm... got same message

sp-rest-proxy master ✗ 4d ◒ ➜ node ./authCheck
TypeError: callback is not a function
    at Object.parseType2Message (/Users/dino/Sites/sp-rest-proxy/node_modules/httpntlm/ntlm.js:116:3)
    at request.then (/Users/dino/Sites/sp-rest-proxy/node_modules/node-sp-auth/lib/src/auth/resolvers/OnpremiseUserCredentials.js:36:33)
    at tryCatcher (/Users/dino/Sites/sp-rest-proxy/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/dino/Sites/sp-rest-proxy/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/Users/dino/Sites/sp-rest-proxy/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/Users/dino/Sites/sp-rest-proxy/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/Users/dino/Sites/sp-rest-proxy/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/Users/dino/Sites/sp-rest-proxy/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/Users/dino/Sites/sp-rest-proxy/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/Users/dino/Sites/sp-rest-proxy/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:781:20)
    at tryOnImmediate (timers.js:743:5)
    at processImmediate [as _immediateCallback] (timers.js:714:5)

It Sharepoint 2013, authentication is handled by Forefront TMG

from sp-rest-proxy.

koltyakov avatar koltyakov commented on June 3, 2024

Hmm, I'm not sure that node-sp-auth (authentication module) works with TMG.
What a coincidence! I was going to test it with TMG upcoming days on one of the projects and environment access to which I do not have yet.

@dinogit, could you please try On-Demand and FBA scenarios? To do it, just rename ./config/private.json to something else and run the proxy or authCheck again and chose these strategies:

image

FBA is likely won't work (it would be crazy, but please try it too).
On-Demand auth should open a browser window in electron for input. On-Demand auth can't work with NTLM, but when using TMG... maybe there a tiny chance. =)

If nothing of these won't work, stay tuned!

@s-KaiNet, just wondering, have you ever had a chance to test node-sp-auth with TMG? If none of existing auth scenarios don't work probably I'll create PR, as for my task I got a lot of work with environment behind TMG.

from sp-rest-proxy.

koltyakov avatar koltyakov commented on June 3, 2024

@s-KaiNet, thanks! We will know it for sure tomorrow when I got to get my hands dirty with TMG on the project I mentioned above.

from sp-rest-proxy.

dinogit avatar dinogit commented on June 3, 2024

hi @s-KaiNet , when using on-demand option, after successful login and hitting submit button, it displays "Loading..." and just stays like that. There are no errors in console.

from sp-rest-proxy.

s-KaiNet avatar s-KaiNet commented on June 3, 2024

Where does it display loading? Can you please post a screen?

from sp-rest-proxy.

dinogit avatar dinogit commented on June 3, 2024

image

from sp-rest-proxy.

koltyakov avatar koltyakov commented on June 3, 2024

Hey @dinogit,

Can you try newly added auth scenario for SharePoint behind TMG?

To do it you should update node-sp-auth and node-sp-auth-config by:

Deleting node_modules folder and yarn.lock or package-lock.json (to avoid possible packages collisions),

and running

npm i node-sp-auth node-sp-auth-config --save-dev

inside a project.

Or it's even better to install sp-rest-proxy 2.4.0 - it contains updated dependencies.

Then delete or rename ./config/private.json, run node ./authCheck and choose Forefront TMG authentication:

image

Auth cookie should be in the following format:

image

I was managed to run few tests with proxy and a new auth method on the environment I have. Everything worked for me. Hope the same on your end. =)

from sp-rest-proxy.

dinogit avatar dinogit commented on June 3, 2024

Hi @koltyakov

It's working 🥇 Thank you very much, you are the awesome

from sp-rest-proxy.

koltyakov avatar koltyakov commented on June 3, 2024

It's an issue in @types/request-promise declarations, just can be ignored.

from sp-rest-proxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.