- 
                Notifications
    You must be signed in to change notification settings 
- Fork 23
feat: password authentication #2061
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
base: main
Are you sure you want to change the base?
Conversation
3081014    to
    784d790      
    Compare
  
    | We don't need to do this in this PR, but we will need to implement the password and google authentication as a setting in the organization settings. When inviting a new user, we will need a flow for typing the new password when accessing the console for the first time, too. | 
d536062    to
    d95c698      
    Compare
  
    d95c698    to
    2dc5295      
    Compare
  
    | templates: | ||
| passwordChanged: | ||
| subject: "✅ Password Changed Successfully" | ||
| body: "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><style>body{font-family:Arial,sans-serif;color:#333}.container{max-width:600px;margin:0 auto;padding:20px}.alert{background:#fff3cd;padding:15px;border-radius:5px;margin:20px 0}</style></head><body><div class=\"container\"><h1>✅ Password Changed Successfully</h1><p>Hello,</p><p>This email confirms that your Bucketeer password has been successfully changed.</p><div class=\"alert\"><strong>Security Notice:</strong> If you did not make this change, please contact your system administrator immediately.</div><p>Thank you for keeping your account secure.</p></div></body></html>" | ||
| passwordSetup: | ||
| subject: "🔐 Set Up Your Bucketeer Password" | ||
| body: "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><style>body{font-family:Arial,sans-serif;color:#333}.container{max-width:600px;margin:0 auto;padding:20px}.button{display:inline-block;padding:12px 24px;background:#007bff;color:white;text-decoration:none;border-radius:5px}.warning{background:#fff3cd;padding:15px;border-radius:5px;margin:20px 0}</style></head><body><div class=\"container\"><h1>Set Up Your Bucketeer Password</h1><p>Hello,</p><p>Your Bucketeer account is ready! To get started, please set up your password by clicking the button below:</p><p style=\"text-align:center;margin:30px 0\"><a href=\"{{setupURL}}\" class=\"button\">Set Up Password</a></p><p>Or copy and paste this link: {{setupURL}}</p><div class=\"warning\"><strong>Security Note:</strong> This link will expire in {{expirationTime}}. Never share this link with anyone. Choose a strong, unique password.</div></div></body></html>" | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we support multiple languages, we need it in the templates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, let me implement it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added ja and en language email template for now.
| demoSignIn: | ||
| enabled: true | ||
| email: demo@bucketeer.io | ||
| password: demo | ||
| organizationId: demo | ||
| organizationOwnerEmail: demo@bucketeer.io | ||
| projectId: demo | ||
| environmentId: demo | ||
| email: "demo@bucketeer.io" | ||
| password: "demo" | ||
| organizationId: "demo" | ||
| organizationOwnerEmail: "demo@bucketeer.io" | ||
| projectId: "demo" | ||
| environmentId: "demo" | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are implementing password authentication to replace the old implementation.
We will also need to update the initialization scripts for the dev container and docker-compose so we can access the console when deploying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I already implemented it, when web service started, it will create demo user's demo password to database.
| @Ubisoft-potato, can you update the PR's description to show the whole flow using Mermaid? | 
| 
 Sure, I will show the whole workflow using Mermaid! | 
| 
 @cre8ivejp I had updated the description with the detailed worflow, please take a look. | 
| @Ubisoft-potato thank you for your great work 💯 | 
1f74eff    to
    8c8b275      
    Compare
  
    8c8b275    to
    d295fa4      
    Compare
  
    …ltiple enabled types
…iple authentication types
…dChangedNotification
…ticationSettings structure
fcf2177    to
    2e05232      
    Compare
  
    
Password Authentication Implementation
Summary
key Changes
Password Setup Workflow
flowchart TD A[Admin Creates New User Account] --> B[System Creates Account in Database] B --> C[System Generates Password Setup Token] C --> D[System Sends Setup Email to User] D --> E[User Clicks Email Link] E --> F[User Sets New Password] F --> G[Password Setup Complete] style C fill:#e8f5e8 style D fill:#fff3e0Process:
flowchart TD A[User Logs in via OAuth] --> B[System Checks if User Has Password] B --> C{Has Password?} C -->|Yes| D[Login Complete - No Action Needed] C -->|No| E[System Generates Password Setup Token] E --> F[System Sends Setup Email to User] F --> G[User Clicks Email Link] G --> H[User Sets New Password] H --> I[User Now Has Both OAuth + Password Login] style E fill:#e8f5e8 style F fill:#fff3e0Process:
Password Setup page workflow
sequenceDiagram participant User participant Frontend participant Backend Note over User, Backend: User receives setup email with setupToken User->>Frontend: Clicks setup link with setupToken Frontend->>Backend: POST /v1/auth/password/setup/validate Note right of Frontend: Body: {"setupToken": "xyz"} Backend-->>Frontend: 200 OK with {"isValid": true, "email": "user@example.com"} alt Token Valid Frontend->>User: Show password setup form with email User->>Frontend: Enters new password Frontend->>Backend: POST /v1/auth/password/setup Note right of Frontend: Body: {"setupToken": "xyz", "newPassword": "newpass"} Backend-->>Frontend: 200 OK or 400 Bad Request alt Setup Success Frontend->>User: Show success message Frontend->>Frontend: Redirect to login page else Setup Failed Frontend->>User: Show error message and keep form open end else Token Invalid Frontend->>User: Show "Invalid Token" error end