summaryrefslogtreecommitdiff
path: root/11-entwurfsheft-kolloquium/assets/diagrams/sequencediagram-forgotAndResetPW.puml
blob: 603130cab8637e987f73031f6267bc0bd1f03a49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@startuml

skinparam ParticipantPadding 30

participant AuthenticationController << (C, #ADD1B2) @Controller >>
-> AuthenticationController: ""POST /api/2/auth/forgot.json"" \n//@RequestBody ForgotPasswordRequest forgotPasswordRequest// \n\n-> forgotPassword(//forgotPasswordRequest//)
activate AuthenticationController
participant AuthenticationService << (C, #ADD1B2) @Service >>
AuthenticationController -> AuthenticationService: forgotPassword(//forgotPasswordRequest//)
activate AuthenticationService
participant JavaMailSenderImpl << (C, #ADD1B2) >>
AuthenticationService -> JavaMailSenderImpl: create link to reset password with JWT as URL parameter \n-> send(SimpleMailMessage simpleMessage) with link
activate JavaMailSenderImpl
<<- JavaMailSenderImpl: sends email with link containing a JWT to reset password
JavaMailSenderImpl --> AuthenticationService
deactivate JavaMailSenderImpl
AuthenticationService --> AuthenticationController: int indicating status
deactivate AuthenticationService
<-- AuthenticationController: ResponseEntity<Integer> indicating status \n\n-> ""HTTP status code""
deactivate AuthenticationController
||60||
-> AuthenticationController: ""PUT /api/2/auth/{username}/resetpassword.json"" \n//@RequestParam String jwt// \n//@RequestBody ResetPasswordRequest resetPasswordRequest// \n\n-> login user (""username"") via JWT (//jwt//) \n-> resetPassword(""username"", //resetPasswordRequest//)
activate AuthenticationController
AuthenticationController -> AuthenticationService: resetPassword(""username"", //resetPasswordRequest//)
activate AuthenticationService
participant JdbcUserDetailsManager << (C, #ADD1B2) @Repository >>
AuthenticationService -> JdbcUserDetailsManager: String oldPassword = //resetPasswordRequest//.getOldPassword() \nString newPassword = //resetPasswordRequest//.getNewPassword() \n-> changePassword(newPassword, oldPassword)
activate JdbcUserDetailsManager
database Database
JdbcUserDetailsManager -> Database: change password of logged in user
activate Database
Database --> JdbcUserDetailsManager
deactivate Database
JdbcUserDetailsManager --> AuthenticationService: int indicating status
deactivate JdbcUserDetailsManager
AuthenticationService --> AuthenticationController: int indicating status
deactivate AuthenticationService
<-- AuthenticationController: ResponseEntity<Integer> indicating status \n\n-> ""HTTP status code""
deactivate AuthenticationController

@enduml