robsontenorio / laravel-keycloak-guard

🔑 Simple Keycloak Guard for Laravel
MIT License
434 stars 141 forks source link

Unable to extend the guard #81

Closed pkarczmarczyk94 closed 1 year ago

pkarczmarczyk94 commented 2 years ago

All KeycloakGuard's properites and methods are private. When we want to overwrite the class to add some additional logic it makes it more complicated. The question is if private is by design or can we change the props to be protected.

We will be happy to provide a PR with the changes if you accept it.

Thanks for the grat package!

robsontenorio commented 2 years ago

Could you name a couple of use cases ?

pkarczmarczyk94 commented 2 years ago

The main use case is checking addiitonal claims in token. We also had a need to add additional properties to user model from token when decoding it.

A bit different topic relating to that is we are working on multi realms for keycloak where we need different configuration for each realm guards and currently we created a fork for that, but if you agree we'll also could create PR for multirealm support.

Making methods protected insead of private would make it easier to extend if needed.

robsontenorio commented 2 years ago

Hmm....I see.

Please, at first submit a PR for make it protected and I will merge it.

If you can, after that, submit another PR with quick draft for multi realms. So, we can take a look together.

Thanks!

lotyp commented 1 year ago

@pkarczmarczyk94 I also am interested in this PR, can help, if needed

lotyp commented 1 year ago

https://github.com/robsontenorio/laravel-keycloak-guard/pull/84

SolveSoul commented 1 year ago

Since the PR above was deleted and never merged I took the liberty to recreate the same PR. #94