Git Product home page Git Product logo

cas's Introduction

CAS

Simple CAS Authentication for Laravel 6-11.x.

This version of CAS, or Central Authentication Service, is designed to integrate with Laravel 6-11 projects that need to implement SSO.
Older version of Laravel may work, but are untested. This package was built for my necessity but can be easily used for anyone requiring CAS/SAML SSO in Laravel 6+. This package is different in mindset as the goal in this project is to be as minimal as possible while offering as much flexibility as needed.

This package offers and abstraction of Apereo CAS (phpCAS), a cross platform and open-source CAS client and server provider. Be sure to check them out if you intend to implement an SSO service other than AD.

Check out the wiki for further details.

ChangeLog

Release 5.0.0

  • Support added for Laravel 11.x
  • Added phpCAS log control
  • Refactor internal design to support tests
  • Add GitHub actions to run tests and linting

Release 4 and earlier

  • Support added for Laravel 10.x
  • Dropped support for phpCAS <1.6.0 (dependency vulnerability)
  • Support added for Laravel 9.x
  • Support added for Laravel 8.x
  • Support added for Laravel 7.x
  • Updated for Laravel 6.x
  • Dropped support for PHP 5.x
  • Laravel 5.5 Package Discovery support
  • CAS logout method supports redirection service as a secondary argument
  • Supports additional CAS versions, including version 1,2,3
  • Supports direct phpCAS calls for heavily customized CAS configurations
  • Supports logon with custom URL redirects
  • Supports logoff with redirect callbacks
  • Updated to work with Laravel 5.2 (backwards compatible)
  • Uses the latest phpCAS
  • Supports verbose logging
  • Session handling has been removed from CAS Manager and is moved strictly into the middleware
  • You can now leverage the CAS sessions instead of relying on Laravel sessions
  • More security fixes
  • Cleaner codebase
  • Backwards compatible (for the most part)
  • More configuration options in the config file available
  • Masquerading as a user now supported
  • Tested and working with PHP 7.x

cas's People

Contributors

abejenaru avatar antoninguyot avatar coolsam726 avatar defrox avatar flartet avatar ganlvtech avatar ipimpat avatar kberzinch avatar m0stwan1ed avatar sdebacker avatar subfission avatar tepeds avatar uyab avatar vitorhugomattos avatar wpeisert avatar wudi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cas's Issues

No support for logout with URL

You did a great job simplifying and updating the library from XavRsl, but now the logout function only checks for a service url instead of allowing parameters. Any plan to include full array parameters or at least logoutWithUrl() support? Our system makes use of this option. I don't mind submitting a PR to help out if the addition works with your plan.

Auth guest check for AJAX does not work

I tried to use this in an ajax app and noticed that it always throws Unauthorized, 401. I found the code in CASAuth.php:

    if ($this->auth->guest())
    {
        if ($request->ajax())
        {
            return response('Unauthorized.', 401);
        }
        $cas = app('cas');
        $cas->authenticate();
    }

Debugging to see how auth could be something else than a guest, I found the single place where user data is stored:

Session::put('cas_user', $this->remoteUser);

but there are no other places where cas_user is processed. Of course, Laravel Auth does not know anything about it and therefore there is no point to check for auth->guest() - it will always be true and you will always end up aborting AJAX requests or requesting auth from phpCAS.

I guess, if you stored cas_user in Session then you should check it in this handle() call to find out if there is valid auth session.

Multiple laravel apps with single sign on? How?

I have 2 (or more) laravel apps, different domain, and non HTTPS (just call authdomain.test and appdomain1.test).. anyone know how to sign in appdomain1.test from authdomain.test? Where should I place this package? for client? or server? How to make it all like google account (authdomain) with all services, like mail, drive, etc. (appdomain1.test)
Can anyone give me the simple example? thanks.. Im confused here for a week.. thanks..

How to get attributes?

What about function phpCAS::getAttributes()?
Can you implement it or we have to do it ourselves?

Cannot config:publish in Laravel 5

I got following error when executed command "php artisan config:publish subfission/cas" =

[[InvalidArgumentException]]
Command "config:publish" is not defined.
Did you mean of these?
vendor:publish
config:clear
config:cache

Please help me. Thank you very much.

Not updated?

Do you no longer support the latest jasig/phpcas?

Authentication is not cleaned from session on logout

The code in Sso.php which is shown below is not working as expected:

if ($this->auth->check()) {
            $this->auth->logout();
        }
Session::flush();
phpCAS::logout();
exit;

Session::flush() does not actually save the session, but only cleans out the variable from memory. Session file is actually saved in Laravel's application shutdown handlers, therefore even auth->logout does not work and keep the id stored in the session if you call exit prematurely.

You should not call exit to allow Laravel's shutdown handlers to do their job.

Alternatively, Session::save() also seems to work.

CasManager::isAuthenticated() only checks locally, not globally

CasManager::isAuthenticated() only checks locally within laravel app if user has authenticated, but not globally with CAS.
If app A (laravel) hasn't authenticated and app B has already authenticated and CAS has a auth session, when CasManager::isAuthenticated() is called from app A, it will return FALSE but it should return TRUE as the user has already been authenticated through another app.
This will seamlessly login in users between different apps (not happening right now).

PHP 7.2

Is it working on PHP 7.2.6? In my machine, changing session header issue.

Redirect route after cas login

I am not able to redirect a route after logging in to the cas, how can I do this?
My route setting is:

Route::get('', function(){
    cas()->authenticate();
    return redirect('/carregarProfessoes');
});

Route::get('/logout', function(){
    cas()->logout();
    return redirect('/');
});

cas()->isAuthenticated() doesn't account for masquerade

When using the masquerade feature to bypass actual authentication, cas()->isAuthenticated() returns false instead of true. I've been able to work around this by modifying line 206 in CasManager.php to look like return $this->config['cas_masquerade'] ? true : phpCAS::isAuthenticated(); rather than the default return phpCAS::isAuthenticated();. Is there a better way to work around this, or is this expected behavior?

BindingResolutionException

Just installed your CAS package and I'm having issues getting some test code to work. I wrote 2 simple routes to test the CAS authentication as follows:

Route::group(['middleware' => ['web']], function () {
    Route::get('/testcas', function(){
        Cas::authenticate();
        redirect('/home');
    });
});

Route::group(['middleware' => ['web', 'cas.auth']], function() {
    Route::get('/home', 'HomeController@index'); 
});

When trying to access the /testcas route, I get an exception:

Illuminate \ Contracts \ Container \ BindingResolutionException

Unresolvable dependency resolving [Parameter #0 [ array $config ]] in class Subfission\Cas\CasManager

I verified that the config file is successfully created and I set a number of values in it. For now, I'm trying to use masquerade until I'm sure I have it working locally, then I'll connect to the CAS server.

Happy to provide more information and/or testing as needed, just let me know. Thanks!

Improve CasManager Binding

As of right now in order to get the CasManager singleton, any class such as this one use app('cas');. Mocking the Laravel's app() helper function in unit tests is not very straightforward, if even feasible. In order to unit test properly, I ended up defining another binding in my AuthServiceProvider:

public function boot() {
    $this->registerPolicies();
    $this->app->bind('Subfission\Cas\CasManager', function ($app) {
           return app('cas');
    });
}

So that my class that requires the CasManager could type hint it in constructor as such:

protected $cas;

public function __construct(CasManager $casManager)
{
    $this->cas = $casManager;
}

Now with this setup I can easily mock CasManager and unit test properly.

Would you be opposed to altering your CasServiceProvider to bind the singleton as follows:

public function register()
{
  // where 'CasManager' implements the 'CasInterface' or the interface could even be called 'Cas'
  $this->app->singleton('CasInterface', function () {
       return new CasManager( config('cas') );
  });
}

I can submit a pull request for it if you're ok with this change.

DOMDocument::loadXML(): Empty string supplied as input

Hello,

First, I'd like to thank subfission & everyone who has contributed to this project. This package works like magic. However, I am running into DOMDocument::loadXML(): Empty string supplied as input when I make cas_enable_saml to true. I am new to authentication & php overall.
And I don't know how to even start to debug this.
.
image
& as you can see in arguments, it is empty
image
This is my config file
image

All help is appreciated. Thank you.

Revision

After I executed command "php artisan vendor:publish subfission/cas", I got some errors:

[RuntimeException]
Too many arguments.

But, if I execute just "php artisan vendor:publish", it succeed:

Copied File [\vendor\subfission\cas\src\config\config.php] To [\config\cas.php]
Publishing Complete!

So, I think the correct command is just "php artisan vendor:publish".

Thank you very much for your cas code.

session file is writing to hd root

Hi all,
I'm upgrading Laravel app from 5.4 to 5.8 and php7.2 and i'm facing strange trouble with auth session :
I'm getting this error " file_put_contents(/idrqlxdraQp8Ek97LIAiF4vFNGN5KX8CI4aE9Y4F): failed to open stream: Permission denied " on login but session file path is correctly setup in configuration file (framework/session).
I'm clearing all cache and config but the problem is allway present !!
I'm think that Cas frameworke is the source of trouble and searching but nothing to do ...
Any one have some idea ??

Thank's
fbm

Cas::logout not working

When calling Cas::logout from my route, the function is not logging out. In fact, using PHP Debug, I can see that the condition phpCAS::isSessionAuthenticated() avoid executing the phpCAS::logout()

How can i change session_save_path in cas?

i want to save cas sessions in storage/sessions, but now it save in php default session_save_path, so how can i change cas session_save_path , when i use this package? Thank u

Login Controller

Is there a way I can use a controller or an app-space middleware (so I can commit it with git) to control logins? I want to make CAS auth (via Auth::login()) my User model, like when using Laravel's native auth system. thnx!

Single sign out

Hi,

I need one help in cas SSO.

If we signout in "CAS" Server, our local(client) application does not logout.

If we logout in CAS Server, then client website also have to logout. Is there any option for this. If there please explain me, it will very help to solve our problem.

Regards,
Senthilkumar

Implementation

Hello. I'm new to Laravel, so please be easy on me. I'm working on my first app and I need to implement CAS Authentication..
please... give me easy tutorial for implementation

Installation guide

Hello,
and first thanks for your CAS Middleware, it saves some time for laravel-beginners like me.

After installing it, I think it could be nice to have the installation guide, like a lot of others packages have, in the Readme. I would be glad if you could review what I wrote down and adding it to your README.

Installation

Composer

composer require subfission/cas

Config file

After adding the package to your project with composer, you should have a new file config/cas.php containing every adjustable parameter. By default, every parameter is usable through .env conf file.
Notice there is a useful cas_masquerade to force a username in a dev environment that might not have access to the CAS server.

Adding the Service Provider and Class alias

config/app.php
'providers' => [ ... , Subfission\Cas\CasServiceProvider::class, ... ]; 'aliases' => [ ... , 'Cas' => Subfission\Cas\Facades\Cas::class, ... ];

Doing so, you're now able to call, for example in a blade template :
{{ Cas::getCurrentUser() }}

Using the middleware

Having a look to https://laravel.com/docs/5.3/middleware is always a good idea.

app\Http\Kernel.php
You can declare the middleware in the $middlewareGroups['web'] to apply it in every web request or only declaring it in the $routeMiddleware = [ ... , 'cas' => \Subfission\Cas\Middleware\CASAuth::class,, ...] to use it explicitly in the routes :
Route::get('test', function() {})->middleware('cas');

CasManager::getAttribute() ignores cas_masquerade

There's a little inconsistency that just bit me: getAttributes() returns null with cas_masquerade enabled, but getAttribute() will forward the call to the phpCAS. Which will obviously result in fatal error.

Unable to update

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Conclusion: remove laravel/framework v5.7.28
- Conclusion: don't install laravel/framework v5.7.28
- Conclusion: don't install laravel/framework v5.7.27
- Conclusion: don't install laravel/framework v5.7.26
- Conclusion: don't install laravel/framework v5.7.25
- Conclusion: don't install laravel/framework v5.7.24
- Conclusion: don't install laravel/framework v5.7.23
- Conclusion: don't install laravel/framework v5.7.22
- Conclusion: don't install laravel/framework v5.7.21
- Conclusion: don't install laravel/framework v5.7.20
- Conclusion: don't install laravel/framework v5.7.19
- Conclusion: don't install laravel/framework v5.7.18
- Conclusion: don't install laravel/framework v5.7.17
- Conclusion: don't install laravel/framework v5.7.16
- Conclusion: don't install laravel/framework v5.7.15
- Conclusion: don't install laravel/framework v5.7.14
- Conclusion: don't install laravel/framework v5.7.13
- Conclusion: don't install laravel/framework v5.7.12
- Conclusion: don't install laravel/framework v5.7.11
- Conclusion: don't install laravel/framework v5.7.10
- Conclusion: don't install laravel/framework v5.7.9
- Conclusion: don't install laravel/framework v5.7.8
- Conclusion: don't install laravel/framework v5.7.7
- Conclusion: don't install laravel/framework v5.7.6
- Conclusion: don't install laravel/framework v5.7.5
- Conclusion: don't install laravel/framework v5.7.4
- Conclusion: don't install laravel/framework v5.7.3
- Conclusion: don't install laravel/framework v5.7.2
- Installation request for subfission/cas dev-master -> satisfiable by subfission/cas[dev-master].
- Conclusion: don't install laravel/framework v5.7.1
- Conclusion: don't install laravel/framework v5.7.0
- subfission/cas dev-master requires illuminate/support 6.x -> satisfiable by laravel/framework[6.x-dev], illuminate/support[6.x-dev, v6.0.0, v6.0.1, v6.0.2, v6.0.3, v6.0.4, v6.1.0, v6.2.0, v6.3.0, v6.4.1, v6.5.0, v6.5.1, v6.5.2, v6.6.0, v6.6.1, v6.6.2, v6.7.0].
- Can only install one of: laravel/framework[6.x-dev, 5.7.x-dev].
- don't install illuminate/support 6.x-dev|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.0.0|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.0.1|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.0.2|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.0.3|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.0.4|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.1.0|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.2.0|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.3.0|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.4.1|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.5.0|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.5.1|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.5.2|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.6.0|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.6.1|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.6.2|don't install laravel/framework 5.7.x-dev
- don't install illuminate/support v6.7.0|don't install laravel/framework 5.7.x-dev
- Installation request for laravel/framework 5.7.* -> satisfiable by laravel/framework[5.7.x-dev, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.12, v5.7.13, v5.7.14, v5.7.15, v5.7.16, v5.7.17, v5.7.18, v5.7.19, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.24, v5.7.25, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9].

Development Port Redirect

My local development environment runs on port 8181. (I have multiple docker instances for other projects on other ports.) On CAS authentication redirect, the service url in the parameter is being encoded as follows:

http%3A%2F%2Flocalhost%3A81%2F&gateway=true

As you can see, the 8181 port is being lost, and 81 is only sent as part of the service.

Set masquerade on function?

Hi! I'm trying to know if there is any way to use cas_masquerade on code and not with .env file. The reason is to have a way on my web application to take the place of a user for testing purposes. This will help us to know some problems about information or actions that a user should have, see errors, etc.

On a local machine we can do this, but we have people that works only with the control panel of the application and they need this option.

Thanks in advance!

Validating certificate

Hello! I'm configuring CAS enviroment variables to validate the server certificate. I've added the variable CAS_VALIDATION=ca and CAS_CERT to the path of the certificate file. But I've always see on the log the following message:

5981 .=> phpCAS::setNoCasServerValidation() [CasManager.php:139] 5981 .| You have configured no validation of the legitimacy of the cas server. This is not recommended for production use. [CAS.php:1618]

I don't understand why is not working.

Thanks!

EDITED
When calling to cas()->getConfig(), I've see something wrong:
"cas_hostname" => "myhost" "cas_session_name" => "CASAuth" "cas_session_lifetime" => 7200 "cas_session_path" => "/" "cas_control_session" => false "cas_port" => 443 "cas_uri" => "/cas" "cas_validation" => "" "cas_cert" => "" "cas_proxy" => false "cas_validate_cn" => true "cas_login_url" => "" "cas_logout_url" => "" "cas_logout_redirect" => "" "cas_redirect_path" => "" "cas_enable_saml" => false "cas_debug" => "phpcas.log" "cas_verbose_errors" => true "cas_masquerade" => "" "cas_real_hosts" => "myhost" "validation" => "ca" "cert" => "autentica.crt"

Instead of cas_cert and cas_validation, the config is using cert and validation.

cas()->getCurrentUser()

Hey, I'm having an issue getting the current user through the CAS server.
I can't get the username using cas()->getCurrentUser(), it returns

Error: Internal script failure

Here's some screenshots of my cas.php :

1
2
3
4
5

Fortunately, I can connect to the server and generate a ticket but I can't get the username :

capture

222

CAS Authentication wanted!

I recently updated to Laravel 5.5 on two separate servers. On one of the servers, when trying to log in via CAS, I get the error

CAS Authentication wanted!
You should already have been redirected to the CAS server. Click here to continue.

Clicking on the "here" link takes me to the appropriate screen, but I'm not sure what the issue could be as the code is identical on both servers. Any ideas? The phpCAS version is 1.3.5 and PHP is 7.0.27

Laravel 7.x

Any plans on updated dependency requirements to support Laravel 7.x?

[enhancement] Add middleware redirect_path to published config

I was confused at first when trying to set redirect_path in the config and then realized it was actually only cas_redirect_path and is quite different. It might be nice to have redirect_path added to the cas config or documented for those using this middleware. Unless I'm missing something entirely :)

referencing RedirectCASAuthenticated.php:26:

if($this->cas->isAuthenticated())
{
    return redirect(config('redirect_path', 'home'));
}

Question about CAS client and server

Am I correct that this is a CAS client (requiring phpCAS in the build) that is designed to interface with a CAS server? If so is there a simple php CAS server that could be recommended?

PHP Laravel Unit Test

Is there a way to Unit test our controllers which are wrapped with CAS middleware?
I try the normal way and got Internal Script failure. But that is understandable as the user is not logged in.
I tried masquerading with a custom user, but still got Internal Script failure while testing.

image

Here's the shot of the route:
image

Here's the basic test case:
image

CAS not redirecting back to Laravel application

I'm not sure if this is an error in my application, or an error in the package, so forgive me if it is an app error!

I'm still testing the package, and I'm not being redirected back to my app after doing CAS authentication.

Route::group(['middleware' => ['web']], function () {
    Route::get('/login', function(){
        Cas::authenticate();
    });
});

Route::group(['middleware' => ['web', 'cas.auth']], function() {
    Route::get('/home', 'HomeController@index'); 
});

I turned on cas_debug and cas_verbose_errors and I have the resulting log file:

2929 .START (2016-04-18 17:09:41) phpCAS-1.3.4 ****************** [CAS.php:469]
2929 .=> phpCAS::client('S1', '<casurl>', 443, '', false) [CasManager.php:43]
2929 .|    => CAS_Client::__construct('S1', false, '<casurl>', 443, '', false) [CAS.php:361]
2929 .|    |    Starting a new session tve2sipa3jfjlgu8ll50k1vo57 [Client.php:906]
2929 .|    <= ''
2929 .<= ''
2929 .=> CAS_Client::handleLogoutRequests(true, array (  0 => '<casurl>',)) [CAS.php:1258]
2929 .|    Not a logout request [Client.php:1701]
2929 .<= ''
2929 .=> phpCAS::setNoCasServerValidation() [CasManager.php:94]
2929 .|    You have configured no validation of the legitimacy of the cas server. This is not recommended for production use. [CAS.php:1618]
2929 .<= ''
2929 .=> phpCAS::setServerLoginURL('<casLoginURL>') [CasManager.php:31]
2929 .<= ''
2929 .=> phpCAS::setServerLogoutURL('<casLogoutURL>') [CasManager.php:32]
2929 .<= ''
2929 .=> phpCAS::isAuthenticated() [CasManager.php:147]
2929 .|    => CAS_Client::isAuthenticated() [CAS.php:1127]
2929 .|    |    => CAS_Client::_wasPreviouslyAuthenticated() [Client.php:1362]
2929 .|    |    |    no user found [Client.php:1604]
2929 .|    |    <= false
2929 .|    |    no ticket found [Client.php:1463]
2929 .|    <= false
2929 .<= false
2929 .=> phpCAS::forceAuthentication() [CasManager.php:105]
2929 .|    => CAS_Client::forceAuthentication() [CAS.php:1080]
2929 .|    |    => CAS_Client::isAuthenticated() [Client.php:1249]
2929 .|    |    |    => CAS_Client::_wasPreviouslyAuthenticated() [Client.php:1362]
2929 .|    |    |    |    no user found [Client.php:1604]
2929 .|    |    |    <= false
2929 .|    |    |    no ticket found [Client.php:1463]
2929 .|    |    <= false
2929 .|    |    => CAS_Client::redirectToCas(false) [Client.php:1258]
2929 .|    |    |    => CAS_Client::getServerLoginURL(false, false) [Client.php:1625]
2929 .|    |    |    <= '<casLoginURL>'
2929 .|    |    |    Redirect to : <casLoginURL> [Client.php:1632]
2929 .|    |    |    exit()
2929 .|    |    |    -
2929 .|    |    -
2929 .|    -

Is there anything I'm missing? I followed the instructions in the Readme and it looks like the CAS integration is mostly working, I just can't tell if the redirect issue is with my code or the package. Thanks for your assistance!

Exception thrown in the middleware stack crashes CAS sessions

Hi,

I'm using Explicit Route Bindings in my app and wanted to test custom 404 pages. And I kept getting those errors:
phpCAS error: phpCAS::client(): ErrorException: session_start(): Cannot send session cache limiter - headers already sent (output started at (...)\vendor\symfony\http-foundation\Response.php:406) in (...)\vendor\subfission\cas\src\Subfission\Cas\CasManager.php on line 61

It took me a while to pinpoint this issue. It happens because Illuminate\Routing\Middleware\SubstituteBindings throws ModelNotFoundException in Illuminate\Routing\RouteBinding and it's rendered as an HTML 404 page. And because this middleware is executed before CASAuth, session_start() that uses native PHP sessions crashes. You can easily test it by creating an middleware that raises an exception and putting it before CASAuth.

I can't move CASAuth middleware to the web stack, becase I need to have some routes accessible without SSO. For now I have extracted the bindings middleware into my web routes, but this needs a better solution, because an exception can happen in other places.

Handle logout Requests from the CASserver

Hi,

How our larave application will get logout requests from CAS Server. I mean, if cas server logged out, the cas server sending one request to client(Laravel application) according to provided service ticket.

Kindly let us know, how can manage this logout requests in our application. If there any example, kindly share to us.

CAS Logout not reflecting

Hi,

I want to say big thanks for this cas plugin.

Everything is working fine, but i have faced only one problem. If we signout in "CAS" website our laravel does not logout if i did any action in application.. Could you please update any idea for this.

Thanks for your help.

Regards,
Sen

How to use?

So forgive me I am new at using laravel, I copied your example code (route::get login example) from the wiki and I can login fine, but it will not log me out and will not redirect me back? I have tried a few different examples the last being:
Route::get('/auth/login', function(){ cas()->authenticate(); return redirect('home'); });

the logout clause is here:

Route::get('/auth/logout')->middleware('cas.auth');

any assistance would be appreciated because this is generally clear as mud to me.

Artisan route:list fails

from my composer file
...
"require": {
"php": "^7.1.3",
"adldap2/adldap2-laravel": "^6.0",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"subfission/cas": "~2.1",
"doctrine/dbal": "^2.10"
},
...

$> artisan route:list
results in errors

ErrorException : Undefined index: HTTP_HOST

at /usr/local/www/sites/intra/vendor/jasig/phpcas/source/CAS/Client.php:3625
3621| } else if (!empty($_SERVER['HTTP_X_FORWARDED_SERVER'])) {
3622| $server_url = $_SERVER['HTTP_X_FORWARDED_SERVER'];
3623| } else {
3624| if (empty($_SERVER['SERVER_NAME'])) {

3625| $server_url = $_SERVER['HTTP_HOST'];
3626| } else {
3627| $server_url = $_SERVER['SERVER_NAME'];
3628| }
3629| }

Exception trace:

1 Illuminate\Foundation\Bootstrap\HandleExceptions::handleError("Undefined index: HTTP_HOST", "/usr/local/www/sites/intra/vendor/jasig/phpcas/source/CAS/Client.php", [])
/usr/local/www/sites/intra/vendor/jasig/phpcas/source/CAS/Client.php:3625

2 CAS_Client::_getClientUrl()
/usr/local/www/sites/intra/vendor/jasig/phpcas/source/CAS/Client.php:3571

Please use the argument -v to see more details.

Whoops\Exception\ErrorException : Module 'imagick' already loaded

at Unknown:0
1|

Exception trace:

1 Whoops\Run::handleError("Module 'imagick' already loaded", "Unknown")
/usr/local/www/sites/intra/vendor/filp/whoops/src/Whoops/Run.php:408

2 Whoops\Run::handleShutdown()
[internal]:0

Single logout not working

Hello and thanks for your great package.
I have built an app and everything works great except single logout.
I excluded from csrf protection and modified the /logout endpoint to look like this

if( cas()->isAuthenticated() ) {
                cas()->logout();
            } else {
                redirect('/');
            }

Note that i am not setting any local session and i have tried both back and front channels from cas server. Also i am not getting any errors on my logs just that the cas has passed from here when i add this line to the controller

Log::info('cas passed from here');

I have already checked issues #25 and #30 and i wans't able to find a solution.
Am i doing something wrong?

https:// vs. http:// CAS redirect

My development environment uses a non secure (http://) CAS service. I have multiple services that authenticate to this CAS server, so using CAS_LOGIN_URL is not an option, because I need to send the service in the URL. Is there an easy way to do this? Adding the http:// in the CAS_HOSTNAME does not work; https:// is still prepended.

Set url logout as service

I'm building a multisite laravel environment with CAS. I need to use different logout_redirect for every site, but my CAS server only allow service parameter as redirect. So when passing a url on logout is not working, because parameter is called url instead of service. Can be possible to change or to add an additional parameter to logout function to use URL as service? Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.