UserProfile module.| Day | Task | Start Date | Completion Date | Reference Material |
|---|---|---|---|---|
| 2 | - Study AWS Cognito User Pools concepts + User Pool configuration: password policies, app clients, PKCE + ID Token vs Access Token — difference and proper usage + Cognito JWT claims: sub, cognito:groups, token_use | 01/13/2026 | 01/13/2026 | https://docs.aws.amazon.com/cognito/ |
| 3 | - Implement Spring Security JWT configuration + Add spring-security-oauth2-resource-server dependency+ Configure SecurityConfig: stateless sessions, CSRF disabled, CORS enabled+ Set Cognito issuer-uri in application.properties+ Write custom OAuth2TokenValidator — reject tokens where token_use != "access" | 01/14/2026 | 01/14/2026 | https://docs.spring.io/spring-security/ |
| 3 | - Implement role extraction from JWT + Read cognito:groups claim → convert to Spring ROLE_<GROUP> authorities+ Configure @PreAuthorize("hasRole('ADMIN')") for admin endpoints+ Define authorization rules: public endpoints, authenticated, admin-only | 01/14/2026 | 01/14/2026 | |
| 4 | - Build UserProfile entity & repository + Fields: cognitoId (UNIQUE), email (UNIQUE), username, name, gender, birthdate, phoneNumber, picture, emailVerified+ UserProfileRepository extends JpaRepository | 01/15/2026 | 01/15/2026 | |
| 4 | - Build UserProfileService & UserProfileController + POST /user/sync — upsert profile from Cognito claims (IDOR-safe: cognitoSub from JWT sub)+ GET /user/{id}, PUT /user/{id}, DELETE /user/{id} | 01/15/2026 | 01/15/2026 | |
| 5 | - Build Frontend LoginScreen+ Single “Sign in with AWS Cognito” button + Initiate PKCE flow via expo-auth-session + expo-web-browser+ Handle redirect callback: exchange code → tokens + Decode ID Token with jwt-decode to extract user claims | 01/16/2026 | 01/16/2026 | https://docs.expo.dev/guides/authentication/ |
| 6 | - Build authSlice (Redux) and token storage + State: isAuthenticated, user, token, refreshToken, hasCompletedOnboarding+ Actions: login, logout, completeOnboarding, updateUserProfile+ Persist tokens to expo-secure-store (mobile) / localStorage (web) via utils/storage.ts- Wire Axios request interceptor: auto-attach Authorization: Bearer <token> | 01/17/2026 | 01/17/2026 |
OAuth2TokenValidator blocks ID tokens — only Access Tokens accepted at the API layer.ROLE_ADMIN group from cognito:groups correctly mapped to grant admin privileges./admin/** routes.POST /user/sync correctly upserts user from Cognito JWT claims without IDOR vulnerability.GET, PUT, DELETE) on /user/{id} with proper authorization checks.UserProfile entity persisted to PostgreSQL via JPA.LoginScreen renders correctly; tapping the button securely opens Cognito Hosted UI in the system browser.expo-auth-session, completely eliminating the need for client-side Secret Keys.authSlice correctly toggles isAuthenticated; RootNavigator redirects to the right stack.code_verifier, code_challenge, and S256, and why it is essential for public clients.iss, aud, exp, nbf, token_use, and signature validation through Cognito JWKs.cognito:groups into internal app roles like ROLE_ADMIN and ROLE_USER to support secure RBAC.sub claim as the stable user identity across all backend modules.In summary, week 2 connected AWS identity concepts directly to the authentication and authorization model of the project.
GlobalExceptionHandler, CorsConfig. Implement the GoalType module (first business module).RootNavigator, AuthStack, MainTabs with custom tab bar, OnboardingStack.