0

In web browser if I give the below url it is working fine.

http://localhost:8080/moqui/rest/s1/User/UserRoleMap/100301,

but if the same url In the mobile app It is getting error like

ionic.bundle.js:24977 GET ionic.bundle.js:24977 GET http://localhost:8080/moqui/rest/s1/User/UserRoleMap/100301 401 (Unauthorized)(anonymous function) @ ionic.bundle.js:24977sendReq @ ionic.bundle.js:24770serverRequest @ ionic.bundle.js:24480processQueue @ ionic.bundle.js:29104(anonymous function) @ ionic.bundle.js:29120$eval @ ionic.bundle.js:30372$digest @ ionic.bundle.js:30188$apply @ ionic.bundle.js:30480(anonymous function) @ ionic.bundle.js:65289defaultHandlerWrapper @ ionic.bundle.js:16764eventHandler @ ionic.bundle.js:16752triggerMouseEvent @ ionic.bundle.js:2953tapClick @ ionic.bundle.js:2942tapMouseUp @ ionic.bundle.js:3018 app.js:116 Apache Tomcat/7.0.63 - Error report

HTTP Status 401 - User must be logged in for operaton list on entity UserRoleMaps

type Status report

message User must be logged in for operaton list on entity UserRoleMaps

description This request requires HTTP authentication.

Apache Tomcat/7.0.63

401 (Unauthorized)(anonymous function) @ ionic.bundle.js:24977sendReq @ ionic.bundle.js:24770serverRequest @ ionic.bundle.js:24480processQueue @ ionic.bundle.js:29104(anonymous function) @ ionic.bundle.js:29120$eval @ ionic.bundle.js:30372$digest @ ionic.bundle.js:30188$apply @ ionic.bundle.js:30480(anonymous function) @ ionic.bundle.js:65289defaultHandlerWrapper @ ionic.bundle.js:16764eventHandler @ ionic.bundle.js:16752triggerMouseEvent @ ionic.bundle.js:2953tapClick @ ionic.bundle.js:2942tapMouseUp @ ionic.bundle.js:3018 app.js:116 Apache Tomcat/7.0.63 - Error report

HTTP Status 401 - User must be logged in for operaton list on entity UserRoleMaps

type Status report

message User must be logged in for operaton list on entity UserRoleMaps

description This request requires HTTP authentication.

Apache Tomcat/7.0.63

even user is login it is getting the same error.

this my UserRoleMap entity

<entity entity-name="UserRoleMap" package-name="moqui.security" short-alias="UserRoleMaps" allow-user-field="false" allow-remote="true">
    <field name="gropMapId" type="id-long" is-pk="true" />
    <field name="persontId" type="text-medium" />
    <field name="child_Id" type="text-medium" />

    // the below relationship parentId mean userId so it maps the childId and get the respective data related to parentId.
    <relationship type="one" title="UserType" related-entity-name="moqui.security.UserAccount" short-alias="childUserDetails">
        <key-map field-name="child_Id" related-field-name="userId"/>
    </relationship>

    <master>
        <detail relationship="childUserDetails"/>
    </master>
</entity> 
Rolla
  • 61
  • 1
  • 7
  • What else are you passing with the request? HTTP Headers? URL Parameters? Authentication is generally required in the form of credentials or an api_key (best in a header for GET requests so it is not sent in plain text, api keys should be treated like passwords). – David E. Jones Jun 14 '16 at 05:07
  • I am passing only UserId as url Parameters . For mobile users after login in through first service like this: locahost:8080/moqui/SignIn/UserLoginWebService?user=1001&password=test@123 The user can able get response for the first service and for the second service mobile user cannot get and response.It is giving the HTTP authentication in between 1st and 2nd session is closed and it is taking as new request and throwing the error.Can i know how to maintain session. – Rolla Jun 14 '16 at 12:00
  • To avoid getting a new session on each request you have to pass along what the Java servlet container expects (currently Jetty embedded in the executable WAR file, was Winstone, though you could drop it into anything). Generally this is a jsessionid cookie. What are you using for the client? Mobile browsers handle this fine from what I've tested... – David E. Jones Jun 15 '16 at 05:06
  • when second request was happened It is not creating any entry in visit table. It is not considering 1st request and asking for login the user.This error is coming in IONIC mobile Developing.If I try in the chrome I can able to see the output and I am not getting any error.The only problem when IONIC mobile developer use this in their APP they are getting the error as the above User must be logged in for operaton list on entity UserRoleMaps. – Rolla Jun 15 '16 at 09:31
  • In browser cookies I can see 2 cookies one cookie contain session_ID other contain Visit_ID. – Rolla Jun 15 '16 at 09:39

0 Answers0