Skip to content
Snippets Groups Projects
Commit 57f8c74c authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FEAT #17590 TIME 1 add azure_saml control

parent c8bd5c6b
No related branches found
No related tags found
No related merge requests found
...@@ -474,6 +474,7 @@ ...@@ -474,6 +474,7 @@
"repoUrl": "https://labs.maarch.org/maarch/MaarchParapheur", "repoUrl": "https://labs.maarch.org/maarch/MaarchParapheur",
"signatureScaling": "Signature block scaling rate", "signatureScaling": "Signature block scaling rate",
"originaleize": "Original size", "originaleize": "Original size",
"scalingDocWith": "{{value}}% of the document width" "scalingDocWith": "{{value}}% of the document width",
"azure_samlConnection": "Azure SAML"
} }
} }
...@@ -485,6 +485,7 @@ ...@@ -485,6 +485,7 @@
"repoUrl": "https://labs.maarch.org/maarch/MaarchParapheur", "repoUrl": "https://labs.maarch.org/maarch/MaarchParapheur",
"signatureScaling": "Taux de mise à l'échelle du bloc de signature", "signatureScaling": "Taux de mise à l'échelle du bloc de signature",
"originaleize": "Taille originale", "originaleize": "Taille originale",
"scalingDocWith": "{{value}} % de la largeur du document" "scalingDocWith": "{{value}} % de la largeur du document",
"azure_samlConnection": "Azure SAML"
} }
} }
...@@ -84,6 +84,7 @@ export class ConnectionComponent implements OnInit { ...@@ -84,6 +84,7 @@ export class ConnectionComponent implements OnInit {
next: () => { next: () => {
this.authService.updateUserInfoWithTokenRefresh(); this.authService.updateUserInfoWithTokenRefresh();
this.notificationService.success('lang.connectionModeUpdated'); this.notificationService.success('lang.connectionModeUpdated');
this.authService.authMode = connection;
}, },
}); });
} }
......
...@@ -101,6 +101,8 @@ export class LoginComponent implements OnInit, AfterViewInit { ...@@ -101,6 +101,8 @@ export class LoginComponent implements OnInit, AfterViewInit {
if (err.status === 401) { if (err.status === 401) {
this.notificationService.error('lang.wrongLoginPassword'); this.notificationService.error('lang.wrongLoginPassword');
loading.dismiss(); loading.dismiss();
} else if (this.authService.authMode === 'azure_saml' && err.error.errors === 'Authentication Failed : not logged') {
window.location.href = err.error.authUri;
} else { } else {
this.notificationService.handleErrors(err); this.notificationService.handleErrors(err);
} }
...@@ -116,7 +118,7 @@ export class LoginComponent implements OnInit, AfterViewInit { ...@@ -116,7 +118,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
} }
initConnection() { initConnection() {
if (['kerberos', 'x509'].indexOf(this.authService.authMode) > -1) { if (['kerberos', 'x509', 'azure_saml'].indexOf(this.authService.authMode) > -1) {
this.loginForm.disable(); this.loginForm.disable();
this.loginForm.setValidators(null); this.loginForm.setValidators(null);
this.onSubmit(); this.onSubmit();
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<ion-header [translucent]="true"> <ion-header [translucent]="true">
<ion-toolbar color="primary"> <ion-toolbar color="primary">
<ion-buttons slot="start"> <ion-buttons slot="start">
<ion-button (click)="authService.logout()" [title]="'lang.logout' | translate" *ngIf="authService.authMode !== 'x509' && authService.authMode !== 'kerberos'"> <ion-button (click)="authService.logout()" [title]="'lang.logout' | translate" *ngIf="authService.authMode !== 'x509' && authService.authMode !== 'kerberos' && authService.authMode !== 'azure_saml'">
<ion-icon slot="icon-only" name="power"></ion-icon> <ion-icon slot="icon-only" name="power"></ion-icon>
</ion-button> </ion-button>
<ion-button *ngIf="!isAdminRoute() && authService.user.administrativePrivileges.length > 0" (click)="openAdmin()" [title]="'lang.administration' | translate"> <ion-button *ngIf="!isAdminRoute() && authService.user.administrativePrivileges.length > 0" (click)="openAdmin()" [title]="'lang.administration' | translate">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment