01-10-2018 03:21 PM
Hi,
I was following the steps in the below article.
Creating your application with ADF
I have configured only Alfresco content services. The configuration is something like this.
{
"/alfresco": {
"target": "https://<<host-name>>/share",
"secure": true,
"changeOrigin": true
}
}
When I enter username and password and click login, below error is thrown,
[HPM] Error occurred while trying to proxy request /alfresco/api/-default-/publi
c/authentication/versions/1/tickets from localhost:4200 to https://<<hostname>>/share (SELF_SIGNED_CERT_IN_CHAIN) (https://nodejs.org/api/errors.h
tml#errors_common_system_errors)
When i change secure to false, it shows you've entered unknown username and password and no error is logged in the console. Kindly suggest the right configuration to connect to a secured alfresco platform.
01-15-2018 07:44 AM
If I understood well, you are trying ADF against Alfresco Content Service only, and your log indicates your ADF application is trying to log in against Activiti.
If you intent to use only Alfresco, and not Activiti, you have to change your adf-login component configuration, something like:
<adf-login
[providers]="'ECM'"
(success)="mySuccessMethod($event)"
(error)="myErrorMethod($event)">
</adf-login>
You can check the component properties at alfresco-ng2-components/login.component.md at master · Alfresco/alfresco-ng2-components · GitHub
01-11-2018 01:31 PM
I have tried the options suggested in the links you gave. The configuration i used is pretty much the same they recommended. I also tried something like the below configuration given in one of the urls.
{ "/angular": { "target": { "host": "github.com", "protocol": "https:", "port": 443 }, "secure": false, "changeOrigin": true, "logLevel": "info" } }
It doesn't work either.
01-12-2018 03:18 PM
Sorry maybe my request wasn't really clear I intend the chrome dev-tools network log
01-12-2018 03:37 PM
Hi,
Here is the chrome console log.
POST http://localhost:4200/activiti-app/app/authentication 404 (Not Found)
scheduleTask @ zone.js:2616
ZoneDelegate.scheduleTask @ zone.js:410
onScheduleTask @ zone.js:300
ZoneDelegate.scheduleTask @ zone.js:404
Zone.scheduleTask @ zone.js:235
Zone.scheduleMacroTask @ zone.js:258
(anonymous) @ zone.js:2640
proto.(anonymous function) @ zone.js:1221
Request._end @ alfresco-js-api.js:29771
Request.end @ alfresco-js-api.js:29677
(anonymous) @ alfresco-js-api.js:159
ZoneAwarePromise @ zone.js:847
callApi @ alfresco-js-api.js:158
(anonymous) @ alfresco-js-api.js:53258
ZoneAwarePromise @ zone.js:847
login @ alfresco-js-api.js:53257
_loginBPMECM @ alfresco-js-api.js:30215
login @ alfresco-js-api.js:30166
AuthenticationService.callApiLogin @ adf-core.umd.js:2891
AuthenticationService.login @ adf-core.umd.js:2848
LoginComponent.performLogin @ adf-core.umd.js:7526
LoginComponent.onSubmit @ adf-core.umd.js:7493
(anonymous) @ LoginComponent.html:7
handleEvent @ core.js:13254
callWithDebugContext @ core.js:14739
debugHandleEvent @ core.js:14326
dispatchEvent @ core.js:9703
(anonymous) @ core.js:10317
(anonymous) @ platform-browser.js:2614
ZoneDelegate.invokeTask @ zone.js:424
onInvokeTask @ core.js:4617
ZoneDelegate.invokeTask @ zone.js:423
Zone.runTask @ zone.js:191
ZoneTask.invokeTask @ zone.js:498
invokeTask @ zone.js:1364
globalZoneAwareCallback @ zone.js:1382
adf-core.umd.js:3031 Error when logging in Error: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /activiti-app/app/authentication</pre>
</body>
</html>
at Request.eval (alfresco-js-api.js:29403)
at Request.Emitter.emit (alfresco-js-api.js:54354)
at XMLHttpRequest.xhr.onreadystatechange (alfresco-js-api.js:29706)
at XMLHttpRequest.wrapFn [as __zone_symbol___onreadystatechange] (zone.js:1069)
at ZoneDelegate.invokeTask (zone.js:424)
at Object.onInvokeTask (core.js:4617)
at ZoneDelegate.invokeTask (zone.js:423)
at Zone.runTask (zone.js:191)
at ZoneTask.invokeTask [as invoke] (zone.js:498)
at invokeTask (zone.js:1364)
AuthenticationService.handleError @ adf-core.umd.js:3031
(anonymous) @ adf-core.umd.js:2858
CatchSubscriber.error @ catchError.js:105
Subscriber._error @ Subscriber.js:130
Subscriber.error @ Subscriber.js:104
(anonymous) @ PromiseObservable.js:73
ZoneDelegate.invoke @ zone.js:391
onInvoke @ core.js:4626
ZoneDelegate.invoke @ zone.js:390
Zone.run @ zone.js:141
(anonymous) @ zone.js:831
ZoneDelegate.invokeTask @ zone.js:424
onInvokeTask @ core.js:4617
ZoneDelegate.invokeTask @ zone.js:423
Zone.runTask @ zone.js:191
drainMicroTaskQueue @ zone.js:595
ZoneTask.invokeTask @ zone.js:502
invokeTask @ zone.js:1364
globalZoneAwareCallback @ zone.js:1382
XMLHttpRequest.send (async)
scheduleTask @ zone.js:2616
ZoneDelegate.scheduleTask @ zone.js:410
onScheduleTask @ zone.js:300
ZoneDelegate.scheduleTask @ zone.js:404
Zone.scheduleTask @ zone.js:235
Zone.scheduleMacroTask @ zone.js:258
(anonymous) @ zone.js:2640
proto.(anonymous function) @ zone.js:1221
Request._end @ alfresco-js-api.js:29771
Request.end @ alfresco-js-api.js:29677
(anonymous) @ alfresco-js-api.js:159
ZoneAwarePromise @ zone.js:847
callApi @ alfresco-js-api.js:158
(anonymous) @ alfresco-js-api.js:53258
ZoneAwarePromise @ zone.js:847
login @ alfresco-js-api.js:53257
_loginBPMECM @ alfresco-js-api.js:30215
login @ alfresco-js-api.js:30166
AuthenticationService.callApiLogin @ adf-core.umd.js:2891
AuthenticationService.login @ adf-core.umd.js:2848
LoginComponent.performLogin @ adf-core.umd.js:7526
LoginComponent.onSubmit @ adf-core.umd.js:7493
(anonymous) @ LoginComponent.html:7
handleEvent @ core.js:13254
callWithDebugContext @ core.js:14739
debugHandleEvent @ core.js:14326
dispatchEvent @ core.js:9703
(anonymous) @ core.js:10317
(anonymous) @ platform-browser.js:2614
ZoneDelegate.invokeTask @ zone.js:424
onInvokeTask @ core.js:4617
ZoneDelegate.invokeTask @ zone.js:423
Zone.runTask @ zone.js:191
ZoneTask.invokeTask @ zone.js:498
invokeTask @ zone.js:1364
globalZoneAwareCallback @ zone.js:1382
01-15-2018 07:44 AM
If I understood well, you are trying ADF against Alfresco Content Service only, and your log indicates your ADF application is trying to log in against Activiti.
If you intent to use only Alfresco, and not Activiti, you have to change your adf-login component configuration, something like:
<adf-login
[providers]="'ECM'"
(success)="mySuccessMethod($event)"
(error)="myErrorMethod($event)">
</adf-login>
You can check the component properties at alfresco-ng2-components/login.component.md at master · Alfresco/alfresco-ng2-components · GitHub
01-15-2018 01:07 PM
Setting providers="ECM" in the login component fixed the issue. Thank you all who helped with this.
Explore our Alfresco products with the links below. Use labels to filter content by product module.