Commit 8f276315 authored by Chris Hines's avatar Chris Hines
Browse files

still having login problems

parent 90f314bf
Pipeline #7541 passed with stages
in 3 minutes and 3 seconds
...@@ -153,10 +153,10 @@ export class AuthorisationService { ...@@ -153,10 +153,10 @@ export class AuthorisationService {
// this.router.navigate(['/']); // this.router.navigate(['/']);
//Verify that the state matched the nonce we used when initiating login //Verify that the state matched the nonce we used when initiating login
let tuple = JSON.parse(localStorage.getItem('authservice')); let tuple = JSON.parse(sessionStorage.getItem('authservice'));
if (tuple == null) { if (tuple == null) {
console.log('token found, but no authService defined'); console.log('token found, but no authService defined');
let data = localStorage.getItem('authservice'); let data = sessionStorage.getItem('authservice');
console.log(data); console.log(data);
return return
} }
...@@ -235,7 +235,7 @@ public getKeys(id?: Identity) { ...@@ -235,7 +235,7 @@ public getKeys(id?: Identity) {
if (!(sshauthzservice.logout === null)) { if (!(sshauthzservice.logout === null)) {
window.open(sshauthzservice.logout); window.open(sshauthzservice.logout);
} }
let path=localStorage.getItem('path'); let path=sessionStorage.getItem('path');
console.log('I should have a keycert now'); console.log('I should have a keycert now');
this.updateAgentContents(); this.updateAgentContents();
console.log('requested agent contens update'); console.log('requested agent contens update');
...@@ -311,10 +311,10 @@ public getKeys(id?: Identity) { ...@@ -311,10 +311,10 @@ public getKeys(id?: Identity) {
let redirect_uri = window.location.origin+this.locationStrategy.getBaseHref()+"sshauthz_callback"; let redirect_uri = window.location.origin+this.locationStrategy.getBaseHref()+"sshauthz_callback";
let nonce=Math.random().toString(36).substring(2, 15) let nonce=Math.random().toString(36).substring(2, 15)
localStorage.setItem('authservice', JSON.stringify([authservice,nonce])); sessionStorage.setItem('authservice', JSON.stringify([authservice,nonce]));
console.log('stored the authservice in localStorage'); console.log('stored the authservice in sessionStorage');
console.log(localStorage.getItem('authservice')); console.log(sessionStorage.getItem('authservice'));
localStorage.setItem('path', this.location.path()); sessionStorage.setItem('path', this.location.path());
if (authservice.scope == null) { if (authservice.scope == null) {
window.location.assign(authservice.authorise+"?response_type=token&redirect_uri="+redirect_uri+"&state="+nonce+"&client_id="+authservice.client_id); window.location.assign(authservice.authorise+"?response_type=token&redirect_uri="+redirect_uri+"&state="+nonce+"&client_id="+authservice.client_id);
} else { } else {
......
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