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
Pipeline #7228 passed with stages
in 5 minutes and 3 seconds
...@@ -201,7 +201,7 @@ export class AuthorisationService { ...@@ -201,7 +201,7 @@ export class AuthorisationService {
this.http.post<any>(this.backendURI+'/getcert',data, options) this.http.post<any>(this.backendURI+'/getcert',data, options)
.pipe(catchError(this.handleError([]))) .pipe(catchError(this.handleError([])))
.subscribe(resp => this.makeKeyCert(newkeypair.private, resp, token.sshauthzservice), .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'); console.log('getcert complete');
} }
...@@ -231,14 +231,12 @@ public getKeys(id?: Identity) { ...@@ -231,14 +231,12 @@ public getKeys(id?: Identity) {
keys.push(keyCert); keys.push(keyCert);
sessionStorage.setItem('keys',JSON.stringify(keys)) sessionStorage.setItem('keys',JSON.stringify(keys))
this.sshAdd(keyCert); 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); // this.tesService.keyCert.next(keyCert);
// As soon as the certificate has been generated, we log back out of the signing server // As soon as the certificate has been generated, we log back out of the signing server
if (!(sshauthzservice.logout === null)) { if (!(sshauthzservice.logout === null)) {
window.open(sshauthzservice.logout); window.open(sshauthzservice.logout);
} }
let path=localStorage.getItem('path');
this.readyToNavigate.next([true,path]); this.readyToNavigate.next([true,path]);
} }
...@@ -348,14 +346,16 @@ public getKeys(id?: Identity) { ...@@ -348,14 +346,16 @@ public getKeys(id?: Identity) {
this.statusMsg.next('There was an error logging in or generating crypto tokens'); this.statusMsg.next('There was an error logging in or generating crypto tokens');
console.error(error); console.error(error);
} }
private httperrorLogout(error: any,sshauthzservice: SshAuthzServer) { private signingError(error: any,sshauthzservice: SshAuthzServer) {
console.log('authorsation service got an error'); this.statusMsg.next('You don\'t appear to have an acocunt on '+sshauthzservice.name);
this.statusMsg.next('There was an error logging out and clearing all tokens');
console.log(error); console.log(error);
if (!(sshauthzservice.logout === null)) { if (!(sshauthzservice.logout === null)) {
window.open(sshauthzservice.logout); window.open(sshauthzservice.logout);
} }
let path=localStorage.getItem('path');
this.readyToNavigate.next([true,path]);
} }
private handleError<T> (result?: T) { private handleError<T> (result?: T) {
return (error: any): Observable<T> => { return (error: any): Observable<T> => {
......
...@@ -57,4 +57,5 @@ export class SshAuthzServer { ...@@ -57,4 +57,5 @@ export class SshAuthzServer {
logout: string; logout: string;
userdefined: boolean; userdefined: boolean;
cafp: string; cafp: string;
signup: string;
} }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div *ngFor="let id of identities"> --> <div *ngFor="let id of identities"> -->
<mat-card style="width: 100%" style="box-sizing: border-box;"> <mat-card style="width: 100%" style="box-sizing: border-box;">
<div *ngIf="identity === undefined || identity == null" > <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>
<div *ngIf="(identity !== undefined) && (identity !== null)"> <div *ngIf="(identity !== undefined) && (identity !== null)">
Jobs running as {{ identity.displayName() }} Jobs running as {{ identity.displayName() }}
......
...@@ -18,15 +18,18 @@ ...@@ -18,15 +18,18 @@
<mat-expansion-panel> <mat-expansion-panel>
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title> <mat-panel-title>
More Services Login
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<div *ngFor="let sshauthzserver of (authService.loggedOutAuthZ | async)" style="width: 100%"> <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> <button mat-icon-button *ngIf="sshauthzserver.userdefined === true"><mat-icon>remove</mat-icon></button>
</div> </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) =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> </mat-expansion-panel>
<div *ngFor="let id of computeSitesService.appidentities | async"> <div *ngFor="let id of computeSitesService.appidentities | async">
<mat-expansion-panel (click)=selectId(id)> <mat-expansion-panel (click)=selectId(id)>
...@@ -38,7 +41,7 @@ ...@@ -38,7 +41,7 @@
</div> </div>
<mat-expansion-panel> <mat-expansion-panel>
<mat-expansion-panel-header> <mat-expansion-panel-header>
Advanced Options Advanced
</mat-expansion-panel-header> </mat-expansion-panel-header>
Select an API server Select an API server
<mat-select [ngModel]="selectedApiServer" (selectionChange)="backendSelectionService.setApiServer($event.value)"> <mat-select [ngModel]="selectedApiServer" (selectionChange)="backendSelectionService.setApiServer($event.value)">
......
...@@ -107,6 +107,10 @@ export class LauncherComponent implements OnInit { ...@@ -107,6 +107,10 @@ export class LauncherComponent implements OnInit {
this.authService.login(sshauthzserver); this.authService.login(sshauthzserver);
} }
signup(sshauthzserver) {
window.open(sshauthzserver.signup);
}
selectId(id: Identity) { selectId(id: Identity) {
this.identity=id; this.identity=id;
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
"name": "CVL", "name": "CVL",
"icon": null, "icon": null,
"scope": "user:email", "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", "authorise": "https://sshauthz.cloud.cvl.org.au/pysshauthz/oauth2/oauth/authorize/google",
...@@ -20,6 +21,7 @@ ...@@ -20,6 +21,7 @@
"name": "CVL with Google ID", "name": "CVL with Google ID",
"icon": null, "icon": null,
"scope": "user:email", "scope": "user:email",
"cafp": "RSA SHA256:cmDxHrZQSPlBMUUcI/BWmruXho1XOzfXPDHSqVTwV2I" "cafp": "RSA SHA256:cmDxHrZQSPlBMUUcI/BWmruXho1XOzfXPDHSqVTwV2I",
"signup": "https://docs.massive.org.au/M3/requesting-an-account.html"
} }
] ]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment