Select to view content in your preferred language

Need help with Web Authentication & Javascript API

4923
5
08-20-2014 06:20 AM
russchandler
New Contributor

I've setup a secure feature service based on user groups. Setup security for Windows Domain, Windows Domain, Web, Web, and set IIS to use Windows Authentication on the WebAdaptor. The issue I'm having is with a feature layer applyEdits call that goes through the proxy and does not allow my browser client to authenticate, thus getting a 401 error.

My question is how can I get my javascript application to work either without hitting the proxy or pass the user credentials through to the WebAdaptor?

-thank you

0 Kudos
5 Replies
MarlaKostuk
New Contributor III

Hi Russ,

There is a DotNet proxy on github that supports windows authentication. This is public but is not fully released so you are more than welcome to try to implement it.

Windows Auth Proxy:

resource-proxy/DotNet at DotNet-Windows_Authentication · afili/resource-proxy · GitHub

Thanks and hopes this helps!

-Marla

0 Kudos
russchandler
New Contributor

Thank you for the reply Marla, but that is the proxy that I'm using. 401 error because the proxy is passing the default network credentials which is the server process user, and not the actual logged in user credentials.

0 Kudos
dmacq
by
New Contributor III

Anybody have any insight into this?  I'm a Silverlight API person moving to the Javascript world.  With Silverlight, Windows Authentication just works.

I've set up the proxy, and it seems to be working as far as cross-domain requests, but I'm not having any luck getting it to work with services that are secured with Windows Authentication.

I have a simple Javascript site.  The site is secured with Windows Authentication, and my services are secured with Windows Authentication.  Even trying to access a service through the proxy directly isn't working.  I'd love if somebody could provide some insight, as I'm not sure how to proceed.

0 Kudos
ChadRicks
New Contributor III

Drew,

I downloaded the daily build dotnet proxy from the github site and it worked for my Widows Authentication locked services.

here is my proxy.config

<?xml version="1.0" encoding="utf-8" ?>

<ProxyConfig allowedReferers="*"

             mustMatch="false">

    <serverUrls>

 

  

        <serverUrl url="https://MachineName/secure/rest/services"

                   matchAll="true"

                   domain="DOMAIN"

                   username="USERNAME"

                   password="PASSWORD" />

    </serverUrls>

</ProxyConfig>

0 Kudos
dmacq
by
New Contributor III

Chad, thanks for this.  I've tried to make this work, and am not having any luck. Just to clarify, "DOMAIN", "USERNAME" and "PASSWORD" are the correct values, and not placeholders for actual domain and login information?

Do you know if HTTPS is required to make this work? That's the only thing I can think of that's preventing this from working.

0 Kudos