-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add github login #129
Comments
Details can be discussed as soon as someone wants to take over the exercise. |
Hello guys, I'm interested to take a look at this issue 😄. Doesn't seems easy to handle but I really want to dive in one of these exercises ! |
@shulard That's cool and if you get this feature in then you're the new prooph-do hero 🥇 First we need to think about the requirements. We should start as simple as possible and split tasks in smaller exercises. At the moment it is only possible to register a single user with his or her username and email. At the PHP Developer Day I talked with @oqq about user management. He told me about an interesting way how to organize user and identity: A User can have one or more Identities. An Identity is a separate aggregate. You can log in with an identity and the application looks up the connected user of that identity. So we can now decide which way we want to go: 1.) Add a Github API Service that can register the github user in proophessor-do using existing commands. Details Option 1If no user exists in the app we redirect the user to new page where they can choose between manual registration (enter username + email) OR github registration. First option uses existing registration mechanism and the new github option uses a new Github API Service. We can use a PHP Github lib. We just need to check what libs are available and what is the best one to use. The user authenticates against Github and we use the Github username and email to register the user in proophessor-do using the existing This option does not include a big change in domain model and focuses more on the Github integration. The intesting thing here is to integrate a third-party service and use a process manager to auto register a user. Details Option 2Option 2 requires more work with the domain model. A new Identity aggregate needs to be added and the current user registration should be refactored. We can also discuss other options. I'm open for suggestions ;) |
Here we go! @codeliner i am not sure about |
Hello @codeliner, Thank you for all the details ! In the project a user can connect with 2 identity as the same user, so option 2 is more interesting in this exercise because it help handling the concept of Also if in the future you want to integrate 2FA the concept of Identity is mandatory I think... |
great. Option 2 is my favorite, too. @shulard Good point regarding 2FA. That is an interesting feature and a good exercise once we have the Identity aggregate. Side notes: I thought about the roadmap of proophessor-do. We have some big maintenance tasks in the pipeline:
When these tasks are done I'd like to host proophessor-do somewhere (maybe we find a sponsor). A real login is mandatory for that, so working on that feature now is great. Having said this, we should only focus at the backend side for the login functionality and keep in mind, that framework variants will be merged. Everything used by the domain needs to be defined by an interface, so that the web frameworks can provide alternative implementations (for example mailer, OAuth client, ...) @oqq Sounds good. Can you provide a rough message flow? I think first step is to expand user registration:
I think that is enough for one exercise. Activating the Identity can be the next excersice as well as login in and log out commands. Github login is also moved to a later exercise. |
Seems a nice first step, I'll start working on it ASAP. |
looks good to me |
@codeliner what if the email address is already in use? |
@oqq Good catch, so we need to switch the order?
"The lost your password" scenario is again a nice excercise. |
Sounds good! Is there a 'best practice' to run all process managers listening for an event in a transaction? |
each command should run in its own transaction. The aggregate defines the transaction boundary, not the process managers. If you need to coordinate work across different aggregates you should use a saga for that. |
@oqq nice work on your implementation. Regardless of the GitHub account/login and just to elaborate a bit more, this issue should/could also be taken much further into Real Life use cases:
|
@oqq are you still working on this? |
@burzum i am not sure what you are referring to. Is it the ticket, or the event sourced user login example? |
@oqq the Github user login. I'm asking because I want to do something as well with proophessor-do and looking for a task. :) |
@burzum sorry, but I have never worked on this issue. Feel free to catch the task. 👍 |
Hi, I would like to catch up and get more into Any objection or anyone is working on this task already? @codeliner |
@ahmed-alaa go for it! |
@codeliner Hi, I started to work on this task, I was reading the comments on the ticket.
What do you think? |
@ahmed-alaa sounds good. Let's try it this way and see how it works out. |
Copy from gitter chat, @codeliner 's idea, from my memory:
The text was updated successfully, but these errors were encountered: