[ADF-2289] Login with oauth2 provider (#2924)

* Fix oauth2 provider

* Add the schema validation

* Improve the login doc with provider "OAUTH"

* fix doc
This commit is contained in:
Maurizio Vitale
2018-02-12 15:25:03 +00:00
committed by Eugenio Romano
parent 3368607aff
commit 37561d1d27
4 changed files with 64 additions and 2 deletions

View File

@@ -332,6 +332,17 @@
}
}
}
},
"oauth2": {
"description": "AUTH configuration parameters",
"type": "object",
"required": [ "host", "clientId", "secret" ],
"properties": {
"host": { "type": "string" },
"authPath": { "type": "string" },
"clientId": { "type": "string" },
"secret": { "type": "string" }
}
}
}
}

View File

@@ -88,7 +88,8 @@ export class AlfrescoApiService {
hostEcm: this.appConfig.get<string>('ecmHost'),
hostBpm: this.appConfig.get<string>('bpmHost'),
contextRoot: 'alfresco',
disableCsrf: this.storage.getItem('DISABLE_CSRF') === 'true'
disableCsrf: this.storage.getItem('DISABLE_CSRF') === 'true',
oauth2 : this.appConfig.get<any>('oauth2')
});
}
}

View File

@@ -174,6 +174,7 @@ export class AuthenticationService {
saveTickets(): void {
this.saveTicketEcm();
this.saveTicketBpm();
this.saveTicketAuth();
}
/**
@@ -194,6 +195,15 @@ export class AuthenticationService {
}
}
/**
* The method save the AUTH ticket in the Storage
*/
saveTicketAuth(): void {
if (this.alfrescoApi.getInstance() && (<any>this.alfrescoApi.getInstance()).getTicketAuth()) {
this.storage.setItem('ticket-AUTH', (<any>this.alfrescoApi.getInstance()).getTicketAuth());
}
}
/**
* The method return true if user is logged in on ecm provider
*