I'd have to look up how we do it currently but generally you want with credentials to be set to true so cookies and all get passed
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials The org wide GitHub search is pretty helpful at finding examples. https://github.com/search?q=org%3Ajenkinsci+xmlhttprequest&type=code Though I'm guessing why very little shows up is most people are using the prototypejs (boo) or jquery ajax helpers. On Wed., Oct. 20, 2021, 5:39 a.m. t4k30ff, <[email protected]> wrote: > Hello, > > I was currently experimenting with jelly and javascript and wrote a > RootAction that would be accessed by the loaded page every second through a > timeout. > The problem i face now is that if i export the hpi from my test server to > a "real" one (it's a server on my laptop aswell but with accounts and > stuff) i get a 403 forbidden and the response reads "Authentication > required". > So i did some research and i found that i have to add the "Authentication" > header to my request with the credentials. > But my problem now is how to get these credentials (mostly password/-hash; > i can get username through ${user.name} in jelly). > > I'd be glad if you could help me. > > Thanks in advance > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-dev/86abd56d-f99f-4ede-9a1a-435bc6a9a651n%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-dev/86abd56d-f99f-4ede-9a1a-435bc6a9a651n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DusyY34mo7uXLYvZcTpmW%3DA%3D4mVPr_sneprvS%2BOUUTTDSg%40mail.gmail.com.
