Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find an example for use of user_provider_custom_retrieve_method #102

Open
makakken opened this issue Nov 30, 2023 · 1 comment
Open

Comments

@makakken
Copy link

Can anyone guide me on how to implement the custom method?

if i understand it right:

  • Create a class that implements: Illuminate\Contracts\Auth\UserProvider
  • overwrite the retrieveByCredentials(array $credentials) inside the class to match own needs
  • now customize the Keycloak-Driver to somehow use the new class

Am i right? am i missing something? WOuld be nice to get some help, maybe someone could point me to a relevant tutorial or something. Thanks.

@dfeneck
Copy link

dfeneck commented Oct 26, 2024

You've probably moved on, but I worked this out the other day.

You don't overwrite the retriveByCredentials method if using user_provider_custom_retrieve_method, that variable defines the name of the additional function you add to your custom UserProvider class. Can name it anything, just supply the name. That function will take two parameters, $token & $credentials.

However there is currently a bug with the package, and it fails to load the user_provider_custom_retrieve_method value, I've created a PR to fix the issue, and added a small additional explanation to make it clearer how you're supposed to use it.

Since I've no way of knowing when the PR will be merged, take a look at the PR to see the 1 liner you need to change to make it load the ENV variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants