I realized that SharePoint exposes a REST GET API. While I am logged into SharePoint, I am able to invoke the API using my browser URL bar without explicitly writing credentials into the GET request. However, I would like to be able to make a request based on that same session in a JavaScript HTTP request (without filling in credentials). Is that possible? If so, how does one do it?
Asked
Active
Viewed 173 times
0
-
Does this answer your question? [How to access Session variables and set them in javascript?](https://stackoverflow.com/questions/15519454/how-to-access-session-variables-and-set-them-in-javascript) – ControlAltDel Feb 24 '20 at 16:47
-
It depends on what variable I need to obtain. From what I can see it should either be a Bearer token or basic auth (username+password). I will have to look into that before I can answer you – mstaal Feb 24 '20 at 17:02
-
No, it does not answer my question. The answer does not tell me how to obtain the parameters I need. Or do you know the names of them, @ControlAltDel? – mstaal Feb 24 '20 at 19:31
-
Does this answer your question? https://stackoverflow.com/questions/6918314/using-javascript-can-you-get-the-value-from-a-session-attribute-set-by-servlet-i/6918356 – ControlAltDel Feb 24 '20 at 19:55
-
From what I can see: No, it does not answer my question. It does _not_ tell me 1) what parameters to obtain, 2) whether they can be obtained, 3) how to make the request – mstaal Feb 24 '20 at 20:08