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-10-2018 03:30 PM
For development purposes, I would suggest using HTTP and configuring HTTPS for production, where you are using a proper server instead of the webpack dev server coming with angular CLI.
As for the proxy, you can refer to the following article: stories proxy · angular/angular-cli Wiki · GitHub
Under the hood it is using the webpack server that might require some additional configuration: https://webpack.js.org/configuration/dev-server/#devserver-https
01-10-2018 03:32 PM
From quick googling: angular-cli server - how to proxy API requests to another server? - Stack Overflow
01-10-2018 04:52 PM
Hi,
I don't have alfresco installed in my system hence i am using the alfresco running in the Dev server. We used to login to dev alfresco using the url - https://<<hostname>>/share
So i have mentioned the configuration as below,
{
"/alfresco": {
"target": "https://<<hostname>>/share",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
}
}
Login never succeed. It always show error as unknown username and password and the here is the console log.
[HPM] POST /alfresco/api/-default-/public/authentication/versions/1/tickets ->
https://<<hostname>>/share
Don't know how to proceed.
What exactly happens when we hit sign in in the login component? As per the above configuration, does it makes a call to https://<<hostname>>/share?
01-10-2018 05:07 PM
Isn't the right configuration something like this?
{
"/alfresco": {
"target": "http://localhost:8080",
"secure": false,
"changeOrigin": true
}
}
Without the /share in the target parameter?
01-11-2018 05:08 AM
As Douglas said you need to remove share from the address plus can you please tell us which version of alfresco content service is running on your server? Please note that ADF works only with the Content service API >= 5.2.0
01-11-2018 11:36 AM
Hi,
Thanks for the reply.
I already tried with /target and without that as well. It does not work.
Yes we are using alfresco 5.2
01-11-2018 11:54 AM
if you could attach a screenshot of your console and network maybe that can help us in order to debug your local problem. Did you start your project using the generator?
01-11-2018 12:34 PM
Here are some of the screenshots. Started the app using npm start.
Tried to login
Console after hit sign in
I observe that the log only shows subscribed to HTTP events. What about HTTPS
?
01-11-2018 12:37 PM
I gave the links for SSL and Angular CLI at the beginning. Did you have a chance to investigate?
Explore our Alfresco products with the links below. Use labels to filter content by product module.