Announcements
Heya
trying to connect to the web services via javascript. Having a really hard time succeeding. Keeps giving me a cors error. Wonder - Is it possible to connect to it with a query param instead of a header param? My experience is, that it is a lot easier. Example:
localhost:endpoint/username=xxxxx&password=&&&&&&
Currently I'm doing as follows (but i keep getting 401 even though I'm certain the credentials are correct.):
It seems i can only authenticate via NTLM. This does not provide a javascript code snippet that is functional. Am not completely sure why this is the case.
Hey Jeffrey
Not too worrid about exposing the credentials as it is an on-premise application. However i will look into switching to Oath2 if possible for a localhosted BC365.
Tried it in postman but can strangely only get it to work with NTLM authentication. This does not provide a code snippet that is functional in Javascript.
Hi,
Its not recommended to use URL with credentials, you can try OAuth.
Thanks.
Hi, This seems to be an authentication issue.
Although Microsoft recommends Oauth, it can still be used until BC21.
You can test it in PostMan and then turn to Code.
Hope this helps.
Thanks.
ZHU
Hi Salomon,
This is vulnerable to web attacks as you exposed the credentials thru url.
Going back to your requirements, Microsoft recommends to use the OAuth 2.0 authentication method. Below links is much easier to understand as it shows an actual procedure how to do it.
robertostefanettinavblog.com/.../
If you find this useful please give it a like or verify the answer. By this way you can help other members know that the topic has been answered. Have a nice day. Thank you.
Cheers,
You should probably switch to Oauth instead of basic authentication.
Here are some links for you:
docs.microsoft.com/.../authenticate-web-services-using-oauth
Not Cors but 401 Unathorized.
André Arnaud de Cal...
294,099
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator