Skip to content

How to Implement authentication in a hexagonal/DDD architecture #45863

Closed Answered by darthf1
bernard-ng asked this question in Q&A
Discussion options

You must be logged in to vote

You can create a SecurityUser class in your Infrastructure folder, implement those interfaces there, and pass your User entity in the constructor. Methods in the Interface can then be forwarded to your entity.

public function getUserIdentifier(): string
{
  return $this->entity->getEmail();
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bernard-ng
Comment options

Answer selected by bernard-ng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants