message: grant type password KEYCLOAK fix
diff: @@ -46,9 +46,7 @@ class Oauth2Auth extends AlfrescoApiClient {
  this.host = this.config.oauth2.host;
  - if (this.config.oauth2.implicitFlow) {
  this.initOauth();// jshint ignore:line
  - }
  if (this.config.accessToken) {
  this.setTicket(this.config.accessToken);
  @@ -494,9 +492,8 @@ class Oauth2Auth extends AlfrescoApiClient {
  var contentTypes = ['application/x-www-form-urlencoded'];
  var accepts = ['application/json'];
  - var url = this.config.oauth2.authPath || '/oauth/token';
  - this.callApi(
  - url, 'POST',
  + this.callCustomApi(
  + this.discovery.tokenEndpoint, 'POST',
  pathParams, queryParams, headerParams, formParams, postBody,
  authNames, contentTypes, accepts, {}
  ).then(
  @@ -507,9 +504,9 @@ class Oauth2Auth extends AlfrescoApiClient {
  },
  (error) => {
  if (error.error.status === 401) {
  - this.promise.emit('unauthorized');
  + this.emit('unauthorized');
  }
  - this.promise.emit('error');
  + this.emit('error');
  reject(error.error);
  });
  Emitter(this.promise); // jshint ignore:line
  @@ -542,8 +539,8 @@ class Oauth2Auth extends AlfrescoApiClient {
  var accepts = ['application/json'];
  this.promise = new Promise((resolve, reject) => {
  - this.callApi(
  - '/oauth/token', 'POST',
  + this.callCustomApi(
  + this.discovery.tokenEndpoint, 'POST',
  pathParams, queryParams, headerParams, formParams, postBody,
  authNames, contentTypes, accepts, {}
  ).then(
  @@ -553,9 +550,9 @@ class Oauth2Auth extends AlfrescoApiClient {
  },
  (error) => {
  if (error.error.status === 401) {
  - this.promise.emit('unauthorized');
  + this.emit('unauthorized');
  }
  - this.promise.emit('error');
  + this.emit('error');
  reject(error.error);
  });
  });
  