mariovalney / laravel-keycloak-web-guard

Simple Keycloak Guard to Laravel Web Routes - https://packagist.org/packages/vizir/laravel-keycloak-web-guard
146 stars 80 forks source link

Sync Keycloak users with Laravel database #35

Closed gpedro closed 3 years ago

gpedro commented 4 years ago

how we can sync users to refer in local database as foreign key?

a sync command can be a cool option to solve that. add user data on login doesn't solve the problem, cuz if you need to refer a user than never logged you can't.

-- related to #34

gpedro commented 4 years ago

we should sync groups too? to make a company relationship?

mariovalney commented 4 years ago

It's a nice use case. But we do not limit developers to use our UserProvider, so it should be a optional/plug-n-play feature.

Said that, I really liked making this a artisan command. I'm just not sure this should be on main service class.

Are you thinking about keep this as a command to run always manually?

gpedro commented 4 years ago

I just registered the command. He doesn’t run automatically.

gpedro commented 4 years ago

so... should i create a sync command to user and groups with attributes? @mariovalney

mariovalney commented 4 years ago

I'm sorry. I'm not sure what you are asking.

gpedro commented 4 years ago

i mean... keycloak users and groups to sync and store on local database via sync command

mariovalney commented 4 years ago

Yes.

As everything is optional/manual (in commands) no problem to add this possibility to developers.

nicosalvadore commented 3 years ago

@gpedro @mariovalney I'm very interested in this feature, as I have to define relationships between users stored in keycloak and other entities in my app. Let me know what can I do to get this merged ! Thank you

gpedro commented 3 years ago

@gpedro @mariovalney I'm very interested in this feature, as I have to define relationships between users stored in keycloak and other entities in my app. Let me know what can I do to get this merged ! Thank you

i will try back to finish that PR.

nicosalvadore commented 3 years ago

@gpedro thank you for the update :)

gpedro commented 3 years ago

guys, I recently tested the Cloudflare Access, it's a feature to prevent unauthorized access on pages. CF integrates with Keycloak using SAML. I guess is a better solution try to use same protocol instead this integration. Since CF uses, looks more mature and solid usage, so i found this: https://github.com/aacotroneo/laravel-saml2

also, we can use socialite with oauth2 (Keycloak)


i will try search more about Keycloak integration on others languages to check how they made it and improve this repository.