kevinoconnor7 / osTicket-auth-cas

JASIG CAS Authentication plugin for osTicket
GNU General Public License v2.0
13 stars 8 forks source link

404 - URL Not Found #34

Closed HugoChaves86 closed 2 years ago

HugoChaves86 commented 2 years ago

Hello, @kevinoconnor7

I have tried the CAS authenticator plugin on osticket v1.14.4 and v1.15.7, both running on php 7.4 and apache2 but it didn't work. After the authentication, the redirection occurs, but i only get the message "URL not found - the requested URL was not found on this server.". The system osTicket was installed on my VM Debian 11 and i've also tried to enable "mod_rewrite" function on Apache server, thinking about the possibility that the problem is with the .htaccess file, but it didn't work either.

I already looked at all the previous issues, tried some possibilities, but I was not successful. Here are some data from my system:

.htaccess file:

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.*/api) RewriteRule ^(.*)$ %1/http.php/$1 [L]

An example of a URL that should serve as a redirect:

http://localhost/api/auth/ext?ticket=ST-12397-wyg50GJviqxIrZ9Xraoi-ca1.ufba.br

Any idea as to what the issue could be?

HugoChaves86 commented 2 years ago

cap

kevinoconnor7 commented 2 years ago

Just to make sure:

  1. this .htaccess file is in the /api directory?
  2. this .htaccess file is readable to your web server?
  3. Does your apache config have AllowOverride none defined somewhere? This would prevent the .htaccess file from being honored.
HugoChaves86 commented 2 years ago

I already configured the web server this way. I can already access on localhost, but when I access externally, I get CAS authentication failure. Any ideas? The field "CA Cert Path" are empty. Should i fill it up somehow?

kevinoconnor7 commented 2 years ago

If "CA Cert Path" path is left empty we simply won't validate the server certificate. So things are more likely to work if it's left empty.

What does "external" mean in this context? Accessing osTicket externally, or is your CAS instance external?

For the former I would make sure that your apache configuration is still appropriate and that any intermediate services (ex. reverse proxies) aren't interfering.

For the latter case either your osTicket server is failing to communicate with your CAS server, or the CAS server is rejecting the ticket validation.

HugoChaves86 commented 2 years ago

Ok, @kevinoconnor7 , i already resolve that issue too. My problem now is, when I access osTicket outside of localhost, the redirect is pointing to localhost/api/auth/ext and not the webserver address (webserver@domain:port/api/auth/ext for example). I'm having to manually change this for it to work. How to fix this?

kevinoconnor7 commented 2 years ago

Did you correctly configure the "Helpdesk URL" in the general osTicket settings?

HugoChaves86 commented 2 years ago

I'm trying to that now.

HugoChaves86 commented 2 years ago

It worked @kevinoconnor7! The problem was that the prefix "http://" was missing at the beginning of the URL. Thanks a lot for the support. Strong hug!