cancel
Showing results for 
Search instead for 
Did you mean: 

Authorisation Fails in REST

wslade
Champ in-the-making
Champ in-the-making
I have deployed a war (on Weblogic Server) with the explorer and the rest apis included.

I can successfully login into the explorer via browser, however when I attempt a GET /myapp/service/deployments from SOAPUI I get a 401 (or from a browser).

Now I have set the username and password in the "Authentication and Security Related settings".
I have tried with the global setting "Adds authentication information to outgoing request" on and off with no difference.

I have no errors in the app log when I start the application server.

Can anyone suggest where I can start debugging on the server.
4 REPLIES 4

frederikherema1
Star Contributor
Star Contributor
Are you using BASIC authentication in your rest-client?
Is your rest and explorer pointing to the same DB, containing the login-data?

wslade
Champ in-the-making
Champ in-the-making
I have only one spring context and they are both using the same database.

Here is the log from the request and the resposne

Thu Jun 28 18:54:36 EST 2012Smiley Very HappyEBUGSmiley Embarassed> "GET /MyService/service/deployments HTTP/1.1[\r][\n]"
Thu Jun 28 18:54:36 EST 2012Smiley Very HappyEBUGSmiley Embarassed> "Accept-Encoding: gzip,deflate[\r][\n]"
Thu Jun 28 18:54:36 EST 2012Smiley Very HappyEBUGSmiley Embarassed> "Authorization: Basic YWRtaW46YWRtaW4=[\r][\n]"
Thu Jun 28 18:54:36 EST 2012Smiley Very HappyEBUGSmiley Embarassed> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
Thu Jun 28 18:54:36 EST 2012Smiley Very HappyEBUGSmiley Embarassed> "Host: localhost:7031[\r][\n]"
Thu Jun 28 18:54:36 EST 2012Smiley Very HappyEBUGSmiley Embarassed> "[\r][\n]"
Thu Jun 28 18:54:36 EST 2012Smiley Very HappyEBUG:<< "HTTP/1.1 401 Unauthorized[\r][\n]"
Thu Jun 28 18:54:36 EST 2012Smiley Very HappyEBUG:<< "HTTP/1.1 401 Unauthorized[\r][\n]"
Thu Jun 28 18:54:36 EST 2012Smiley Very HappyEBUG:<< "Date: Thu, 28 Jun 2012 08:54:36 GMT[\r][\n]"
Thu Jun 28 18:54:36 EST 2012Smiley Very HappyEBUG:<< "Content-Length: 1518[\r][\n]"
Thu Jun 28 18:54:36 EST 2012Smiley Very HappyEBUG:<< "Content-Type: text/html; charset=UTF-8[\r][\n]"
Thu Jun 28 18:54:36 EST 2012Smiley Very HappyEBUG:<< "WWW-Authenticate: Basic realm="WebLogic Server"[\r][\n]"

frederikherema1
Star Contributor
Star Contributor
That should just work… A good starting-point to debug is org.activiti.rest.application.ActivitiRestApplication.authenticate(Request, Response) and org.activiti.rest.application.ActivitiRestApplication line:90:


authenticator = new ChallengeAuthenticator(null, true, ChallengeScheme.HTTP_BASIC,
          "Activiti Realm") {

First thing I notice is the difference in "Realm".. Try using "Activiti Realm" instead of "Weblogic Server"

wslade
Champ in-the-making
Champ in-the-making
I tried the alt realm (no success) however it appears that weblogic auth is taking the request.

Another thread suggested the inclusion of <enforce-valid-basic-auth-credentials>false</enforce-valid-basic-auth-credentials> in the config.xml which has worked.