Jahia in English > Jahia 401 unauthorized...

0 (0 Good)
0 (0 Bad)

Jahia 401 unauthorized Access Issue

by  prashant.gangwar@soprasteria.com »  2017/01/17 12:59

Hi,

I have created a module in my project and using some ajax calls in project so when I am logged in to the site and testing out these urls, they are working fine . But when I tried it without logged in then I am not able to get data from these ajax calls , instead of when looked into console log it was 401 - Unauthorized access.

Can someone help me to solve this issue?

In my log file I am getting this as follows:-

2017-01-17 17:48:16 INFO  ErrorLoggingFilter:303 - Authorization required for resource: /cms/render/live/en/sites/mySite/flow-1-questions/pagecontent/node.someCall.do
Request information:
URL: /cms/render/live/en/sites/mySite/flow-1-questions/pagecontent/node.someCall.do
Method: POST
Protocol: HTTP/1.1
Remote host: 127.0.0.1
Remote address: 127.0.0.1
Remote port: 56276
Remote user: null
Session ID: 271D5112C1E2D51CBF39C826DAEEF664
Session user: guest
Request headers: 
  host: localhost:8080
  connection: keep-alive
  accept: application/json, text/javascript, */*; q=0.01
  x-requested-with: XMLHttpRequest
  user-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
  referer: http://localhost:8080/sites/mySite/flow-1-questions.html
  accept-encoding: gzip, deflate, sdch, br
  accept-language: en-US,en;q=0.8
  cookie: historyPagingGrid=%7B%22state%22%3A%7B%22offset%22%3A%22i%3A0%22%2C%20%22limit%22%3A%22i%3A50%22%7D%7D; JSESSIONID=271D5112C1E2D51CBF39C826DAEEF664

  (prashant.gangwar@soprasteria.com)

Number of messages  5
Registration date
1 (1 Good)
0 (0 Bad)

Re: Jahia 401 unauthorized Access Issue

by  wassek »  2017/01/17 13:19

Hello,

 

When you deifne the ajax action, did you add requireAuthenticatedUser false?

Like:

<property name="requireAuthenticatedUser" value="false"/>

 

If yes can you attach your definition of your action?

 

regards,

Werner

Werner Assek (wassek)

Number of messages  26
Registration date
0 (0 Good)
0 (0 Bad)

Re: Re: Jahia 401 unauthorized Access Issue

by  Prashant »  2017/01/17 13:49

Hi Werner,

 

Thanks for this quick help.

After adding requireAuthenticatedUser, ajax calls are working and getting data now. But when i try to submit form, it's redirecting to login page of jahia (even i used requireAuthenticatedUser for defining the definitions in xml file as per ajax call I have used).

 

 

 

Prashant
Number of messages  1
Not registered
0 (0 Good)
0 (0 Bad)

Re: Re: Jahia 401 unauthorized Access Issue

by  prashant.gangwar@soprasteria.com »  2017/01/19 07:14

Hi Werner,

Thanks for this quick help. 

After adding requireAuthenticatedUser, ajax calls are working and getting data now. But when i try to submit form, it's redirecting to login page of jahia (even i used requireAuthenticatedUser for defining the definitions in xml file as per ajax call I have used).

Is there any specific reason for that?

  (prashant.gangwar@soprasteria.com)

Number of messages  5
Registration date
Contact
Share
Feedback

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page