Comments (17)
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.
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.
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.
Hi @koltyakov I have updated yarn and it's working
from sp-rest-proxy.
Hi there @dinogit,
Can you try using relative URLs starting with '/'?
E.g. '/_api/web' not '_api/web'.
from sp-rest-proxy.
Hi @koltyakov
tried that first, it didn't work
How can I check if authentication succeeded?
from sp-rest-proxy.
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:
or an error if something wrong with the creds or network or something. E.g.:
from sp-rest-proxy.
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.
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.
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:
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.
@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.
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.
Where does it display loading? Can you please post a screen?
from sp-rest-proxy.
from sp-rest-proxy.
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
:
Auth cookie should be in the following format:
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.
Hi @koltyakov
It's working 🥇 Thank you very much, you are the awesome
from sp-rest-proxy.
It's an issue in @types/request-promise
declarations, just can be ignored.
from sp-rest-proxy.
Related Issues (20)
- Identical requests - succeeding and failing HOT 4
- Can this react app be deployed as a web app on to a windows server so that users can access the app outside of the server ? HOT 6
- Host "sp-rest-proxy" as an independent web-app on Azure or pass authentication in configs to be used in CI/CD pipeline HOT 1
- Can this proxy be used when the host SP environment (on prem) has a "strict-origin-when-cross-origin" HTTP referrer policy? HOT 3
- sharepoint MFA bypass HOT 2
- [Feature query] Can the proxy be made to connect to multiple sites? HOT 1
- sp-rest-proxy with sharepointplus HOT 10
- POST request fails when calling the proxy (adding extra path to sharepoint request) HOT 5
- Proxy Error: Cannot read properties of null (reading 'toString') (see more in sp-rest-proxy console) HOT 4
- Version 3.3.4 broken for OnpremiseUserCredentials HOT 5
- Cannot read properties of null (reading 'toString') HOT 3
- On Demand - cannot read properties of null / childprocess.spawnsync EONENT Error HOT 2
- Proxy approach for Azure Active Directory HOT 2
- Typescript import HOT 1
- Setting siteUrl programatically HOT 4
- sp-rest-proxy does not work with Node 18.16.0 (current LTS) HOT 5
- Thank you HOT 1
- Docker HOT 2
- JSOM using sp-rest-proxy / clarification needed HOT 9
- 401 When Running in Docker HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sp-rest-proxy.