cas icon indicating copy to clipboard operation
cas copied to clipboard

how use CAS with spatie laravel-permission

Open cod3r0k opened this issue 4 years ago • 2 comments

Hi, I want to use CAS library and then use spatie laravel-permission for the permission of my laravel app.

Could you help me how can I integrate and use them?

cod3r0k avatar Oct 28 '20 04:10 cod3r0k

Likely this would be integrated into an auth driver, middleware, and a model. Perhaps try stackoverflow?

subfission avatar Nov 25 '20 03:11 subfission

Hi, I want to use CAS library and then use spatie laravel-permission for the permission of my laravel app.

Could you help me how can I integrate and use them?

I don't see how these two depend on each other. I personally use both packages in all my project. Here is my Authentication logic:

Authentication:

  1. I have internal users table with a username field that corresponds to the one returned by the cas service.
  2. Redirect to the CAS endpoint for authentication. Once authenticated, this simply returns a username.
  3. Find a user with the returned username. If found, Login the user manually using Laravel's Auth::login($user) feature

Authorization: Follow the normal procedure outlined in spatie/laravel-permission's documentation. There won't be any conflicts.

coolsam726 avatar Feb 24 '21 10:02 coolsam726