Skip to content

Commit

Permalink
Update SequenceDiagram.FHIR-Directory.fdv.search.puml
Browse files Browse the repository at this point in the history
Ablauf für Such durch Versicherte in Fachanwendungen
  • Loading branch information
gem-uhe authored Dec 6, 2023
1 parent c5e9c0b commit f5b1a4c
Showing 1 changed file with 25 additions and 33 deletions.
58 changes: 25 additions & 33 deletions src/plantuml/SequenceDiagram.FHIR-Directory.fdv.search.puml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
autonumber 1 1 "<b>[00]"
title "FHIR-VZD Authentisierung für Versicherte"

participant VClient as "Client Versicherter"

box Fachanwendung #WhiteSmoke
participant VClient as "Client Versicherter"
participant FDienst as "Fachdienst"
end box

box VZD-FHIR-Directory #WhiteSmoke
participant "OAuth-Server" as VzdOAuth
Expand All @@ -15,36 +19,35 @@ participant hs as "Matrix-Homeserver\n(Messenger-Proxy)"

VClient-> VClient: prüfe ob noch gültiges search-ACCESS_TOKEN\nvom FHIR-Directory Auth-Service vorliegt

alt kein gültiges search-ACCESS_TOKEN vorhanden - TIM Client
VClient-> hs: POST /_matrix/client/r0/user/{userId}/openid/request_token
activate hs
hs --> VClient: HTTP 200 OK, Result body {"access_token": "Matrix-OpenID-Token",..., "matrix_server_name": "example.com",...}
deactivate hs
else kein gültiges search-ACCESS_TOKEN vorhanden - alle anderen Clients
VClient->VzdOAuth++: POST /token (client_id, client_secret)
alt kein gültiges search-ACCESS_TOKEN vorhanden
VClient-> FDienst: Anfrage search-ACCESS_TOKEN

alt kein gültiges REFRESH_TOKEN vorhanden
FDienst ->VzdOAuth++: POST /token (client_id, client_secret)
VzdOAuth->VzdOAuth: prüfe client_id, client_secret
VzdOAuth-->VClient: patient-accesstoken
VzdOAuth-->FDienst: patient-accesstoken
deactivate VzdOAuth
end

VClient->VzdAuth++: GET /patient-authenticate \n(Authorization: "Bearer patient-accesstoken ODER Matrix-OpenID-Token")

alt kein gültiges search-ACCESS_TOKEN vorhanden - Authorization mit Matrix-OpenID-Token
FDienst->VzdAuth++: GET /patient-authenticate \n(Authorization: "grant_type=Bearer patient-accesstoken")

VzdAuth-> VzdAuth: Prüfe ob matrix_server_name\nin Föderationsliste enthalten
VzdAuth-> hs: GET /openid/userinfo/\nrequest header, Authorization: Bearer Matrix-OpenID-Token
activate hs
hs --> VzdAuth: HTTP 200 OK\n(Result Body MXID des Nutzers)
deactivate hs
VzdAuth->VzdAuth: Prüfe patient-accesstoken

else kein gültiges search-ACCESS_TOKEN vorhanden - Authorization mit patient-accesstoken
VzdAuth->VzdAuth: Erzeuge search-ACCESS_TOKEN & REFRESH_TOKEN
VzdAuth-->FDienst: HTTP 200 OK, Result body mit search-ACCESS_TOKEN & REFRESH_TOKEN\n{"access_token"="search-ACCESS_TOKEN", "token_type":"bearer",\n"expires_in":86400\n"refresh_token"="REFRESH_TOKEN", "token_type":"refresh_token"}
deactivate VzdAuth
else gültiges REFRESH_TOKEN vorhanden
FDienst->VzdAuth++: GET /patient-authenticate \n(Authorization: "grant_type=refresh_token REFRESH_TOKEN")

VzdAuth->VzdAuth: Prüfe patient-accesstoken
end
VzdAuth->VzdAuth: Prüfe REFRESH_TOKEN

VzdAuth->VzdAuth: Erzeuge search-ACCESS_TOKEN & REFRESH_TOKEN
VzdAuth--> VClient: HTTP 200 OK, Result body mit search-ACCESS_TOKEN & REFRESH_TOKEN\n{"access_token"="search-ACCESS_TOKEN", "token_type":"bearer",\n"expires_in":86400}
VzdAuth->VzdAuth: Deaktiviere altes REFRESH_TOKEN
VzdAuth-->FDienst: HTTP 200 OK, Result body mit search-ACCESS_TOKEN & REFRESH_TOKEN\n{"access_token"="search-ACCESS_TOKEN", "token_type":"bearer",\n"expires_in":86400\n"refresh_token"="REFRESH_TOKEN", "token_type":"refresh_token"}
deactivate VzdAuth
end

FDienst-->VClient: search-ACCESS_TOKEN
end

== ...Suche durch Versicherte im FHIR VZD... ==

Expand All @@ -63,15 +66,4 @@ fp --> VClient : HTTP 401
deactivate fp
end

== ...search-ACCESS_TOKEN abgelaufen... ==

VClient->VzdAuth++: GET /patient-authenticate \n(Authorization: "Bearer REFRESH_TOKEN")
VzdAuth->VzdAuth: Prüfe REFRESH_TOKEN
VzdAuth->VzdAuth: Erzeuge search-ACCESS_TOKEN & REFRESH_TOKEN
VzdAuth->VzdAuth: Deaktiviere altes REFRESH_TOKEN

VzdAuth-->VClient: Response (search-ACCESS_TOKEN & REFRESH_TOKEN)
deactivate VzdAuth
deactivate VzdAuth

@enduml

0 comments on commit f5b1a4c

Please sign in to comment.