subfission / cas

Simple CAS Authentication for Laravel 5 - 10.
MIT License
151 stars 70 forks source link

Undefined array key "cas_client_service" #121

Closed legendscraft closed 11 months ago

legendscraft commented 1 year ago

The array key _cas_clientservice has not been defined in parseConfig

https://github.com/subfission/cas/blob/ca3150f42ccf84d1e2c232ce84327f799697a0e9/src/Subfission/Cas/CasManager.php#L121

Below is the error I am getting as a result of this

2023-03-29_10-19

subfission commented 1 year ago

This identified some missing proper error handling.

But you are missing your config values for the service, which caused the error: https://github.com/subfission/cas/blob/9fed4eb7496c5caec45c3f6a9112a211eded39e7/src/config/config.php#L68

desyashasyi commented 1 year ago

Hi, I have the same problem. I use the config file of the previous version of Laravel 9. But when I enable the 'cas_client_service' => env('CAS_CLIENT_SERVICE', 'http://localhost'),

I got this error

image

I changed to 'cas_client_service' => env('CAS_CLIENT_SERVICE', '127.0.0.1:8000'),

The problem is similar

desyashasyi commented 1 year ago

So which setting should be used?

SvenMandic commented 1 year ago

Hi, I have the same problem. I use the config file of the previous version of Laravel 9. But when I enable the 'cas_client_service' => env('CAS_CLIENT_SERVICE', 'http://localhost'),

I got this error

image

I changed to 'cas_client_service' => env('CAS_CLIENT_SERVICE', '127.0.0.1:8000'),

The problem is similar

I have same error. Did you manage to fix this?

Glifaus commented 1 year ago

Hi! I have got the same error earlier today.

I fixed it by updating cas.php file in config comparing with original: cas/src/config/config.php And adding to the .env file this new parameter: CAS_CLIENT_SERVICE="http://xxxxxxx.test/" When this url is the local environment url to my project. Check carefully Cas.php config to change the url's needed.

desyashasyi commented 1 year ago

Hi, I have the same problem. I use the config file of the previous version of Laravel 9. But when I enable the 'cas_client_service' => env('CAS_CLIENT_SERVICE', 'http://localhost'), I got this error image I changed to 'cas_client_service' => env('CAS_CLIENT_SERVICE', '127.0.0.1:8000'), The problem is similar

I have same error. Did you manage to fix this?

Hi, I have the same problem. I use the config file of the previous version of Laravel 9. But when I enable the 'cas_client_service' => env('CAS_CLIENT_SERVICE', 'http://localhost'), I got this error image I changed to 'cas_client_service' => env('CAS_CLIENT_SERVICE', '127.0.0.1:8000'), The problem is similar

I have same error. Did you manage to fix this?

I still have such error

desyashasyi commented 1 year ago

Hi! I have got the same error earlier today.

I fixed it by updating cas.php file in config comparing with original: cas/src/config/config.php And adding to the .env file this new parameter: CAS_CLIENT_SERVICE="http://xxxxxxx.test/" When this url is the local environment url to my project. Check carefully Cas.php config to change the url's needed.

I tried your solution, but there is another error

image

desyashasyi commented 11 months ago

is there any update?

subfission commented 11 months ago

Hi folks, this is not a bug in this codebase. This error is because you are sending a SAML request to a nonexistent resource or an endpoint that does not support the SAML/CAS protocols. Please check your SAML targets and match your config to them. These should be your SAML providers.

For reference see: https://github.com/subfission/cas/blob/9fed4eb7496c5caec45c3f6a9112a211eded39e7/src/Subfission/Cas/CasManager.php#L121C3-L121C3

Check phpCAS for more detail on how this is used correctly.