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

How to get user attributes like username, user id, etc? #13

Closed nmbatingal closed 4 years ago

nmbatingal commented 4 years ago

Hello,

How can I fetch additional user attributes like user id, username data?

Thank you in advance!

Best, Nars

mariovalney commented 4 years ago

From Keycloak?

You can create your own User Model and extend Models/KeycloakUser to add custom data to attributes like a regular model.

nmbatingal commented 4 years ago

Thank you for your response. I somewhat followed your FAQs and googled more references.

gpedro commented 4 years ago

check my solution #32 if you want another custom attribute, you need to add to mapper (keycloak configuration) and fillable (user model)