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

loadUserByUsernameAndPayload is never called in my Custom User Providers in chain configuration #754

Closed
incatech-ai opened this issue May 28, 2020 · 0 comments · Fixed by #683

Comments

@incatech-ai
Copy link

incatech-ai commented May 28, 2020

Hi,

I have two distinct Custom User Providers for two different user types ClientUserProvider and CustomerUserProvider, each of this provider implements PayloadAwareUserProviderInterface when I used either of the providers in the firewall the method is called but when I configured the two to be a chain and use it in the firewall the loadUserByUsernameAndPayload is never called it only calls the default loadUserByUsername.

providers:
	client_security_user_provider:
	  id: App\Security\ClientUserProvider
	customer_security_user_provider:
	  id: App\Security\CustomerUserProvider
	chained_security_user_provider:
		chain:
			providers: ['client_security_user_provider','customer_security_user_provider']
			
	# customer firewall    
	api_customer:
		pattern:    ^/v1/customer
		stateless: true
		anonymous: false
		provider:  customer_security_user_provider
		guard:
			authenticators:
				- lexik_jwt_authentication.jwt_token_authenticator
				
	# client firewall    
	api_customer:
		pattern:    ^/v1/client
		stateless: true
		anonymous: false
		provider:  client_security_user_provider
		guard:
			authenticators:
				- lexik_jwt_authentication.jwt_token_authenticator
				
	# client and customer shared firewall    
	api_customer:
		pattern:    ^/v1/common
		stateless: true
		anonymous: false
		provider:  chained_security_user_provider
		guard:
			authenticators:
				- lexik_jwt_authentication.jwt_token_authenticator
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

Successfully merging a pull request may close this issue.

1 participant