Skip to content
Snippets Groups Projects
Commit 0b417ee2 authored by Chris Hines's avatar Chris Hines
Browse files

made sure an error message shows if you don't have an account, added signup links for CVL

parent 49a0be92
No related branches found
No related tags found
2 merge requests!21New css dev,!5Dev
Pipeline #7228 passed
......@@ -201,7 +201,7 @@ export class AuthorisationService {
this.http.post<any>(this.backendURI+'/getcert',data, options)
.pipe(catchError(this.handleError([])))
.subscribe(resp => this.makeKeyCert(newkeypair.private, resp, token.sshauthzservice),
error => this.httperrorLogout(error,token.sshauthzservice));
error => this.signingError(error,token.sshauthzservice));
console.log('getcert complete');
}
......@@ -231,14 +231,12 @@ public getKeys(id?: Identity) {
keys.push(keyCert);
sessionStorage.setItem('keys',JSON.stringify(keys))
this.sshAdd(keyCert);
let path=localStorage.getItem('path');
console.log('authorisation complete, ready to navigate back to the correct view',path);
// this.tesService.keyCert.next(keyCert);
// As soon as the certificate has been generated, we log back out of the signing server
if (!(sshauthzservice.logout === null)) {
window.open(sshauthzservice.logout);
}
let path=localStorage.getItem('path');
this.readyToNavigate.next([true,path]);
}
......@@ -348,14 +346,16 @@ public getKeys(id?: Identity) {
this.statusMsg.next('There was an error logging in or generating crypto tokens');
console.error(error);
}
private httperrorLogout(error: any,sshauthzservice: SshAuthzServer) {
console.log('authorsation service got an error');
this.statusMsg.next('There was an error logging out and clearing all tokens');
private signingError(error: any,sshauthzservice: SshAuthzServer) {
this.statusMsg.next('You don\'t appear to have an acocunt on '+sshauthzservice.name);
console.log(error);
if (!(sshauthzservice.logout === null)) {
window.open(sshauthzservice.logout);
}
let path=localStorage.getItem('path');
this.readyToNavigate.next([true,path]);
}
private handleError<T> (result?: T) {
return (error: any): Observable<T> => {
......
......@@ -57,4 +57,5 @@ export class SshAuthzServer {
logout: string;
userdefined: boolean;
cafp: string;
signup: string;
}
......@@ -6,7 +6,7 @@
<div *ngFor="let id of identities"> -->
<mat-card style="width: 100%" style="box-sizing: border-box;">
<div *ngIf="identity === undefined || identity == null" >
Select your username an compute site on the left to see running jobs or start new jobs.
Click login and select a provider or select one you've already logged in to.
</div>
<div *ngIf="(identity !== undefined) && (identity !== null)">
Jobs running as {{ identity.displayName() }}
......
......@@ -18,15 +18,18 @@
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
More Services
Login
</mat-panel-title>
</mat-expansion-panel-header>
<div *ngFor="let sshauthzserver of (authService.loggedOutAuthZ | async)" style="width: 100%">
<button mat-button (click)=login(sshauthzserver) fxFlex style="text-align: left"> Run on {{ sshauthzserver.name }}</button>
<button mat-button (click)=login(sshauthzserver) fxFlex style="text-align: left"> Login to {{ sshauthzserver.name }}</button>
<button mat-icon-button *ngIf="sshauthzserver.userdefined === true"><mat-icon>remove</mat-icon></button>
</div>
<div *ngFor="let sshauthzserver of (authService.loggedOutAuthZ | async)" style="width: 100%">
<button mat-button (click)=signup(sshauthzserver) style="width: 100%; text-align: left"> Signup for {{ sshauthzserver.name }}</button>
</div>
<button mat-button (click) =logout() style="width: 100%; text-align: left">Logout</button>
<button mat-button (click) ="authService.updateAgentContents()" style="width: 100%; text-align: left">Refresh Services</button>
<button mat-button (click) ="authService.updateAgentContents()" style="width: 100%; text-align: left">Refresh</button>
</mat-expansion-panel>
<div *ngFor="let id of computeSitesService.appidentities | async">
<mat-expansion-panel (click)=selectId(id)>
......@@ -38,7 +41,7 @@
</div>
<mat-expansion-panel>
<mat-expansion-panel-header>
Advanced Options
Advanced
</mat-expansion-panel-header>
Select an API server
<mat-select [ngModel]="selectedApiServer" (selectionChange)="backendSelectionService.setApiServer($event.value)">
......
......@@ -107,6 +107,10 @@ export class LauncherComponent implements OnInit {
this.authService.login(sshauthzserver);
}
signup(sshauthzserver) {
window.open(sshauthzserver.signup);
}
selectId(id: Identity) {
this.identity=id;
......
......@@ -9,7 +9,8 @@
"name": "CVL",
"icon": null,
"scope": "user:email",
"cafp": "RSA SHA256:cmDxHrZQSPlBMUUcI/BWmruXho1XOzfXPDHSqVTwV2I"
"cafp": "RSA SHA256:cmDxHrZQSPlBMUUcI/BWmruXho1XOzfXPDHSqVTwV2I",
"signup": "https://docs.massive.org.au/M3/requesting-an-account.html"
},
{
"authorise": "https://sshauthz.cloud.cvl.org.au/pysshauthz/oauth2/oauth/authorize/google",
......@@ -20,6 +21,7 @@
"name": "CVL with Google ID",
"icon": null,
"scope": "user:email",
"cafp": "RSA SHA256:cmDxHrZQSPlBMUUcI/BWmruXho1XOzfXPDHSqVTwV2I"
"cafp": "RSA SHA256:cmDxHrZQSPlBMUUcI/BWmruXho1XOzfXPDHSqVTwV2I",
"signup": "https://docs.massive.org.au/M3/requesting-an-account.html"
}
]
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