Community
Showing results for 
Search instead for 
Do you mean 
Reply

Getting a 401 (Unauthorized) Error

Copper Elite Contributor
Posts: 82
Country: Canada

Getting a 401 (Unauthorized) Error

[ Edited ]

I recently installed web api version 1.0.54.0 on a server 2012/Act 18.1 machine and now whenever i click the Test button on the help page, i get a 401 error with a description of "Unauthorized" in the browser's console. I am entering the correct credentials and nothing is logged in the windows event log either.

 

 401.PNG

 

It doesn't seem to matter what i enter for the username/pw, or db name. If i leave everything blank, i still get the same error. I had installed version 1.0.26.0 on another server, and if i enter incorrect credentials, i get an "Invalid logon provided." 401 error, and if i leave everything blank, i get a 500 error. So there is definitely something wrong with the 1.0.54.0 install. It doesn't seem to be machine specific. I installed it on a Win7 machine and got the same results.


Any help would be appreciated.

 

Ahsan Khalid

Chief Technology Officer
Keystroke Quality Computing Inc.
www.keystroke.ca

Employee
Posts: 236
Country: USA

Re: Getting a 401 (Unauthorized) Error

Is it possible other elements have changed?  For example, you are hosting multiple Act! for Web apps on the server and weren't before, or have added a new database, or the like?  Lastly, can you make sure you can access Act! for Web and the database isn't locked (Tools->Database Maintenance->Lock/Unlock DB).

Copper Elite Contributor
Posts: 82
Country: Canada

Re: Getting a 401 (Unauthorized) Error

[ Edited ]

Hi Xavier,

 

Nothing has changed outside of installing the Web API. On my machine (Windows 7), I had the old version of Web API installed and it worked fine. Today I installed the new version and now it is not working. The server never had Web API installed but it also has the same error as my machine. The databases are not locked either. 

Ahsan Khalid

Chief Technology Officer
Keystroke Quality Computing Inc.
www.keystroke.ca

Employee
Posts: 236
Country: USA

Re: Getting a 401 (Unauthorized) Error

Ok thanks, that rules out the usual.  We've tested upgrading to .54 internally, we haven't seen any systematic issue.  One option you could try is uninstalling Web API, making sure all files are removed, and re-installing Web API.  

Copper Elite Contributor
Posts: 82
Country: Canada

Re: Getting a 401 (Unauthorized) Error

[ Edited ]

For some reason, after reinstalling Web API, it enabled Windows Authentication in IIS settings. After I disabled it, it started working fine.


However, this only seems to be working on the default "APFW" virtual directory. If a database was linked to a non-standard virtual directory, I get the error: "Could not find any database named 'dbname' configured to be exposed for web access"

 

Is this by design or a bug? For us, it is critical to have multiple databases on their own virtual directory/app pool for security reasons and having everyone share the default virtual dir will not work.

 

Thanks,

Ahsan Khalid

Chief Technology Officer
Keystroke Quality Computing Inc.
www.keystroke.ca

Employee
Posts: 236
Country: USA

Re: Getting a 401 (Unauthorized) Error

[ Edited ]

There's a number of steps to perform if you are hosting multiple APFW apps.  We'll be publishing a KB on this.  

 

Basically, you have to deploy Web API for each app.  You then have a choice of a global admin.xml, or one per AFPW.  Then, you need to add an entry in each Web API config file, to link it to each admin.xml, e.g.:

 

<add key="AdminFileLocation" value="C:\Program Files (x86)\ACT\Act for Web\ tenant1-api\PadFiles\Admin.xml" />.

Copper Elite Contributor
Posts: 82
Country: Canada

Re: Getting a 401 (Unauthorized) Error

Hi Xavier,

 

Has the KB article for this been published yet? I haven't had the change to mess around with this more but if there isn't much else to do than what you listed in your last message, please let me know so i can do some more testing.


Thanks,

Ahsan Khalid

Chief Technology Officer
Keystroke Quality Computing Inc.
www.keystroke.ca

Employee
Posts: 236
Country: USA

Re: Getting a 401 (Unauthorized) Error

Not yet, but should be this week.  I'll be sure to notify this thread as soon as it is published.

Copper Elite Contributor
Posts: 82
Country: Canada

Re: Getting a 401 (Unauthorized) Error

[ Edited ]

Hi Xavier,

 

Sorry to bug you again but since i didn't see any updates last week so i figured I'd bump this thread to see when we can expect the documentation for this.

 

Thanks for your help so far.

 

Ahsan Khalid

Chief Technology Officer
Keystroke Quality Computing Inc.
www.keystroke.ca

Employee
Posts: 236
Country: USA

Re: Getting a 401 (Unauthorized) Error

Hi,

 

The document is complete, and Rachel will be sending to ACCs ASAP.