Page 1 of 1

Access to the requested resource has been denied

PostPosted:Fri May 11, 2012 11:11 am
by fre3man
Hi there,

I am really in need of help to resolve this issue.

I had installed OpenKM5.1.9 on a Windows Server and also onto Apache Server 2.2.

I was able to access the login page. But once i try to login with a valid user, i hit the an error as per image attached.

I had tried to amend the login-config.xml to access a different database [MySQL] and the error popped out.
Code: Select all
<!-- OpenKM -->
    <application-policy name = "OpenKM">
       <authentication>
          <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
            <!--
			<module-option name="dsJndiName">java:/OpenKMDS</module-option>
            <module-option name="principalsQuery">select usr_password as PASSWD from OKM_USER where usr_id=? and usr_active='T'</module-option>
            <module-option name="rolesQuery">select ur_role as ROLEID, 'Roles' from OKM_USER_ROLE where ur_user=?</module-option>
            <module-option name="hashAlgorithm">md5</module-option>
            <module-option name="hashEncoding">hex</module-option>
			-->
		    <module-option name="dsJndiName">java:/MySqlDS</module-option>
            <module-option name="principalsQuery">Select cryptpassword as PASSWD from OKM_USER  where login_name=?</module-option>
            <module-option name="rolesQuery">select ROLEID, 'Roles' from OKM_USER_ROLE  where user_id=?</module-option>
          </login-module>
		  <!-- <login-module code="org.jboss.security.ClientLoginModule" flag="required" /> -->
       </authentication>
    </application-policy>
Please advise. Really need to resolve this asap.

Let me know if more information is required to resolve it. :cry:

Thanks in advance!!!

Re: Access to the requested resource has been denied

PostPosted:Sun May 13, 2012 9:31 am
by fre3man
Hi all,

I tried to link back to HSQL database instead of MySQL database to avoid the above error mentioned.

But yet i hit another issue:
Code: Select all
Error getting translations: 404 <html><head><title>JBossWeb/2.0.1.GA - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /OpenKM/frontend/Language</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/OpenKM/frontend/Language</u></p><p><b>description</b> <u>The requested resource (/OpenKM/frontend/Language) is not available.</u></p><HR size="1" noshade="noshade"><h3>JBossWeb/2.0.1.GA</h3></body></html>
Is this due to JBoss not able to recognize the request sent from apache web server?
I had tried to access OpenKM directly via the port 8200 which i had set it initially, and not via Apache web server. I was able to reach the main page.

PLease advise how can i resolve this.

Re: Access to the requested resource has been denied

PostPosted:Tue May 15, 2012 6:20 am
by jllort
In this post you have added two different type of question, separate jboss - apache problem ( with login )

Execute the select select in your database ( all users should have at least UserRole if not you get the reason why you are getting access denied)
Code: Select all
ur_role as ROLEID, 'Roles' from OKM_USER_ROLE where ur_user=?
You have change default openkm database poll, why ?
Code: Select all
<module-option name="dsJndiName">java:/MySqlDS</module-option>
Have you changed openkm-dx.xml too ?

Re: Access to the requested resource has been denied

PostPosted:Thu May 17, 2012 1:18 am
by fre3man
Hi jilort,

Yes, i have solved this issue on the denied problem thanks to your help. It seems my previous link is linking to older table with role as 'UserRol'. I have update it and it is working fine.

Regarding the second part, i believe you are referring to openkm-ds.xml?
I did not made any changes to the file. but rather, i add a new file 'mysql-ds.xml' to enable access for OpenKM to retrieve the role and password from MySQL table instead of HSQL database. Is this change the cause of the 2nd issue i posted?

Re: Access to the requested resource has been denied

PostPosted:Thu May 17, 2012 10:24 am
by jllort
I do not understanding the scenario, all data should be in same table, this idea using hypersonic for something and mysql for other is strange and dangerous.

You should try executing in your users database the query I place there to see if it's executing correctly and you're getting expected results otherside you get this kind of error.