Skip to content

Commit

Permalink
Work on IUA
Browse files Browse the repository at this point in the history
  • Loading branch information
qligier committed Sep 14, 2024
1 parent 98eda60 commit 4c20378
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
15 changes: 15 additions & 0 deletions angular/src/app/fhirConfig.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@ export class FhirConfigService {
} as AuthConfig;
}

getAuthCodeFlowConfigForEHS(): AuthConfig {
return {
loginUrl: 'https://ehealthsuisse.ihe-europe.net/iua-simulator/rest/ch/authorize',
tokenEndpoint: 'https://ehealthsuisse.ihe-europe.net/iua-simulator/rest/ch/token',
clientId: this.getClientSecret(),
redirectUri: location.origin + location.pathname,
customQueryParams: {
aud: location.origin + location.pathname,
},
responseType: 'code',
showDebugInformation: true,
timeoutFactor: 0.75,
} as AuthConfig;
}

getAuthCodeFlowConfig(provider: string): AuthConfig {
const idpAlias = provider ? ("/alias/" + provider) : "";
return {
Expand Down
5 changes: 3 additions & 2 deletions angular/src/app/mag/mag.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,9 @@ export class MagComponent implements OnInit {
async onAuthenticate() {
this.cache();
this.scopes = null;
const authCodeFlowConfig = await this.fhirConfigService.getAuthCodeFlowConfigFromMetadata('https://ehealthsuisse.ihe-europe.net/iua-simulator/rest/ch/.well-known');
console.log(authCodeFlowConfig);
//const authCodeFlowConfig = await
// this.fhirConfigService.getAuthCodeFlowConfigFromMetadata('https://ehealthsuisse.ihe-europe.net/iua-simulator/rest/ch/.well-known');
const authCodeFlowConfig = this.fhirConfigService.getAuthCodeFlowConfigForEHS();
authCodeFlowConfig.scope = `person_id=${this.targetIdentifier2Value}^^^&2.16.756.5.30.1.127.3.10.3&ISO purpose_of_use=urn:oid:2.16.756.5.30.1.127.3.10.5|NORM subject_role=urn:oid:2.16.756.5.30.1.127.3.10.6|`;
if (this.authenticate.value === 'HCP') {
authCodeFlowConfig.scope += `HCP`;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
<style>html{--mat-bottom-sheet-container-text-font:Roboto, "Helvetica Neue", sans-serif;--mat-bottom-sheet-container-text-line-height:20px;--mat-bottom-sheet-container-text-size:14px;--mat-bottom-sheet-container-text-tracking:normal;--mat-bottom-sheet-container-text-weight:400}html{--mat-legacy-button-toggle-text-font:Roboto, "Helvetica Neue", sans-serif;--mat-standard-button-toggle-text-font:Roboto, "Helvetica Neue", sans-serif}html{--mat-expansion-header-text-font:Roboto, "Helvetica Neue", sans-serif;--mat-expansion-header-text-size:15px;--mat-expansion-header-text-weight:400;--mat-expansion-header-text-line-height:inherit;--mat-expansion-header-text-tracking:inherit;--mat-expansion-container-text-font:Roboto, "Helvetica Neue", sans-serif;--mat-expansion-container-text-line-height:20px;--mat-expansion-container-text-size:14px;--mat-expansion-container-text-tracking:normal;--mat-expansion-container-text-weight:400}html{--mat-stepper-container-text-font:Roboto, "Helvetica Neue", sans-serif;--mat-stepper-header-label-text-font:Roboto, "Helvetica Neue", sans-serif;--mat-stepper-header-label-text-size:14px;--mat-stepper-header-label-text-weight:400;--mat-stepper-header-error-state-label-text-size:14px;--mat-stepper-header-selected-state-label-text-size:14px;--mat-stepper-header-selected-state-label-text-weight:500}html{--mat-toolbar-title-text-font:Roboto, "Helvetica Neue", sans-serif;--mat-toolbar-title-text-line-height:32px;--mat-toolbar-title-text-size:20px;--mat-toolbar-title-text-tracking:normal;--mat-toolbar-title-text-weight:500}html{--mat-bottom-sheet-container-text-color:rgba(0, 0, 0, .87);--mat-bottom-sheet-container-background-color:white}html{--mat-bottom-sheet-container-text-font:Roboto, sans-serif;--mat-bottom-sheet-container-text-line-height:20px;--mat-bottom-sheet-container-text-size:14px;--mat-bottom-sheet-container-text-tracking:.0178571429em;--mat-bottom-sheet-container-text-weight:400}html{--mat-legacy-button-toggle-text-color:rgba(0, 0, 0, .38);--mat-legacy-button-toggle-state-layer-color:rgba(0, 0, 0, .12);--mat-legacy-button-toggle-selected-state-text-color:rgba(0, 0, 0, .54);--mat-legacy-button-toggle-selected-state-background-color:#e0e0e0;--mat-legacy-button-toggle-disabled-state-text-color:rgba(0, 0, 0, .26);--mat-legacy-button-toggle-disabled-state-background-color:#eeeeee;--mat-legacy-button-toggle-disabled-selected-state-background-color:#bdbdbd;--mat-standard-button-toggle-text-color:rgba(0, 0, 0, .87);--mat-standard-button-toggle-background-color:white;--mat-standard-button-toggle-state-layer-color:black;--mat-standard-button-toggle-selected-state-background-color:#e0e0e0;--mat-standard-button-toggle-selected-state-text-color:rgba(0, 0, 0, .87);--mat-standard-button-toggle-disabled-state-text-color:rgba(0, 0, 0, .26);--mat-standard-button-toggle-disabled-state-background-color:white;--mat-standard-button-toggle-disabled-selected-state-text-color:rgba(0, 0, 0, .87);--mat-standard-button-toggle-disabled-selected-state-background-color:#bdbdbd;--mat-standard-button-toggle-divider-color:#e0e0e0}html{--mat-standard-button-toggle-height:48px}html{--mat-legacy-button-toggle-text-font:Roboto, sans-serif;--mat-standard-button-toggle-text-font:Roboto, sans-serif}html{--mat-divider-color:rgba(0, 0, 0, .12)}html{--mat-expansion-container-background-color:white;--mat-expansion-container-text-color:rgba(0, 0, 0, .87);--mat-expansion-actions-divider-color:rgba(0, 0, 0, .12);--mat-expansion-header-hover-state-layer-color:rgba(0, 0, 0, .04);--mat-expansion-header-focus-state-layer-color:rgba(0, 0, 0, .04);--mat-expansion-header-disabled-state-text-color:rgba(0, 0, 0, .26);--mat-expansion-header-text-color:rgba(0, 0, 0, .87);--mat-expansion-header-description-color:rgba(0, 0, 0, .54);--mat-expansion-header-indicator-color:rgba(0, 0, 0, .54)}html{--mat-expansion-header-collapsed-state-height:48px;--mat-expansion-header-expanded-state-height:64px}html{--mat-expansion-header-text-font:Roboto, sans-serif;--mat-expansion-header-text-size:14px;--mat-expansion-header-text-weight:500;--mat-expansion-header-text-line-height:inherit;--mat-expansion-header-text-tracking:inherit;--mat-expansion-container-text-font:Roboto, sans-serif;--mat-expansion-container-text-line-height:20px;--mat-expansion-container-text-size:14px;--mat-expansion-container-text-tracking:.0178571429em;--mat-expansion-container-text-weight:400}html{--mat-sidenav-container-divider-color:rgba(0, 0, 0, .12);--mat-sidenav-container-background-color:white;--mat-sidenav-container-text-color:rgba(0, 0, 0, .87);--mat-sidenav-content-background-color:#fafafa;--mat-sidenav-content-text-color:rgba(0, 0, 0, .87);--mat-sidenav-scrim-color:rgba(0, 0, 0, .6)}html{--mat-stepper-header-icon-foreground-color:white;--mat-stepper-header-selected-state-icon-background-color:#6a844d;--mat-stepper-header-selected-state-icon-foreground-color:white;--mat-stepper-header-done-state-icon-background-color:#6a844d;--mat-stepper-header-done-state-icon-foreground-color:white;--mat-stepper-header-edit-state-icon-background-color:#6a844d;--mat-stepper-header-edit-state-icon-foreground-color:white;--mat-stepper-container-color:white;--mat-stepper-line-color:rgba(0, 0, 0, .12);--mat-stepper-header-hover-state-layer-color:rgba(0, 0, 0, .04);--mat-stepper-header-focus-state-layer-color:rgba(0, 0, 0, .04);--mat-stepper-header-label-text-color:rgba(0, 0, 0, .54);--mat-stepper-header-optional-label-text-color:rgba(0, 0, 0, .54);--mat-stepper-header-selected-state-label-text-color:rgba(0, 0, 0, .87);--mat-stepper-header-error-state-label-text-color:#f44336;--mat-stepper-header-icon-background-color:rgba(0, 0, 0, .54);--mat-stepper-header-error-state-icon-foreground-color:#f44336;--mat-stepper-header-error-state-icon-background-color:transparent}html{--mat-stepper-header-height:72px}html{--mat-stepper-container-text-font:Roboto, sans-serif;--mat-stepper-header-label-text-font:Roboto, sans-serif;--mat-stepper-header-label-text-size:14px;--mat-stepper-header-label-text-weight:400;--mat-stepper-header-error-state-label-text-size:16px;--mat-stepper-header-selected-state-label-text-size:16px;--mat-stepper-header-selected-state-label-text-weight:400}html{--mat-toolbar-container-background-color:whitesmoke;--mat-toolbar-container-text-color:rgba(0, 0, 0, .87)}html{--mat-toolbar-standard-height:64px;--mat-toolbar-mobile-height:56px}html{--mat-toolbar-title-text-font:Roboto, sans-serif;--mat-toolbar-title-text-line-height:32px;--mat-toolbar-title-text-size:20px;--mat-toolbar-title-text-tracking:.0125em;--mat-toolbar-title-text-weight:500}body{background:#eff0e7}body{margin:0;width:100%;height:100%;font-family:Roboto,Arial,sans-serif}</style><link rel="stylesheet" href="styles.9022959394317ac6.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.9022959394317ac6.css"></noscript></head>
<body>
<app-root></app-root>
<script src="runtime.b36ad241e7dd5c21.js" type="module"></script><script src="polyfills.faaea47b1b6ef438.js" type="module"></script><script src="main.8a6673335e446905.js" type="module"></script></body>
<script src="runtime.b36ad241e7dd5c21.js" type="module"></script><script src="polyfills.faaea47b1b6ef438.js" type="module"></script><script src="main.02addadb5bfb7b47.js" type="module"></script></body>
</html>
1 change: 1 addition & 0 deletions src/main/resources/static/main.02addadb5bfb7b47.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/main/resources/static/main.8a6673335e446905.js

This file was deleted.

0 comments on commit 4c20378

Please sign in to comment.