participant "Consumer" as Consumer #F6C589 participant "Accredited Data Recipient" as ADR #98D7C4 participant "Data Holder" as DH #62B6E4 lifelinestyle Consumer #F6C589:4 lifelinestyle ADR #98D7C4:4 lifelinestyle DH #62B6E4:4 note over Consumer, DH #dce4e5:** Step 1: Setup consent request activate ADR #98D7C4 Consumer -#F6C589:4> ADR:Establish TLS 1.2 Consumer -#F6C589:4> ADR:Provide consent via consent screens ADR -#98D7C4:4> ADR:Create signed request object with\nrequested scopes and claims ADR -#98D7C4:4> DH:Establish MTLS 1.2 ADR -#98D7C4:4> DH:Call par end point with request object DH -#62B6E4:4> DH:Validate request\nobject signature DH -#62B6E4:4> ADR:Cache object and return\nrequest URI reference ADR -#98D7C4:4> Consumer:Redirect (HTTP 302) to DH\nauthorize end point with\nrequest uri reference deactivate ADR space 5 note over Consumer, DH #dce4e5:** Step 2: Authorise consent activate DH #62B6E4 Consumer -#F6C589:4> DH:Establish TLS 1.2 Consumer -#F6C589:4> DH:Call authorize end point as per ADR 302 redirect DH -#62B6E4:4> DH:Validate authorize\nparameters against \nregistered client\ninformation DH -#62B6E4:4> DH:Get request object\nfrom par cache and \nvalidate contents DH -#62B6E4:4> Consumer:Show authentication page Consumer -#F6C589:4> DH:Provide user ID DH -#62B6E4:4> Consumer:Send out of band OTP Consumer -#F6C589:4> DH:Provide OTP to complete authentication DH -#62B6E4:4> DH:Determine if consumer\nhas multiple profiles opt #efdd83 DH -#62B6E4:4> Consumer:Ask consumer to select profile Consumer -#F6C589:4> DH:Profile selected (determines sharing context) end DH -#62B6E4:4> Consumer:Present consent authorisation screens Consumer -#F6C589:4> DH:Confirm consent authorisation opt #efdd83 DH -#62B6E4:4> Consumer:Present account list for inclusion Consumer -#F6C589:4> DH:Select accounts to include in sharing (including JAMS) end DH -#62B6E4:4> Consumer:Request final approval Consumer -#F6C589:4> DH:Approve authorisation DH -#62B6E4:4> DH:Generate ADR facing\nauthorization-code DH -#62B6E4:4> DH:Store arrangement details alt #7bc0e0 if existing arrangement_id included in consent DH -#62B6E4:4> DH:Update arrangement to\nindicate continuity end DH -#62B6E4:4> Consumer:Redirect (HTTP 302) back to ADR\nwith accept state and authorization-code deactivate DH space 5 note over Consumer, DH #dce4e5:** Step 3: Exchange tokens Consumer -#F6C589:4> ADR:Redirect to redirect URI\nwith accept state and\nauthorization-code activate ADR #98D7C4 ADR -#98D7C4:4> ADR:Validate the authorization-code\nand ensure it relates to\nan initiated consent ADR -#98D7C4:4> DH:Establish MTLS 1.2 ADR -#98D7C4:4> DH:Call token end point\nwith authorization-code DH -#62B6E4:4> DH:Validate stored consent\nand authorization-code DH -#62B6E4:4> DH:Generate access-token\nand refresh token DH -#62B6E4:4> DH:Bind access-token with\nclient certificate thumbprint DH -#62B6E4:4> ADR:Return access-token\nand refresh-token deactivate ADR space 5 note over Consumer, DH #dce4e5:** Step 4: Call resource end point activate ADR #98D7C4 ADR -#98D7C4:4> DH:Establish MTLS 1.2 alt #84d6bb if no valid access token ADR -#98D7C4:4> DH:Call token end point\nwith refresh token DH -#62B6E4:4> DH:Generate access token\nand optional new refresh token DH -#62B6E4:4> DH:Bind access token with\nclient certificate thumbprint DH -#62B6E4:4> ADR:Return access token\nand optional new refresh token end ADR -#98D7C4:4> DH:Call resource end point\nwith access token DH -#62B6E4:4> DH:Validate access token validity\nand certificate thumbprint DH -#62B6E4:4> DH:Validate scopes and\nclaims as needed DH -#62B6E4:4> ADR:Return CDR data deactivate ADR