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.
Solved! Go to Solution.
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
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
From quick googling: angular-cli server - how to proxy API requests to another server? - Stack Overflow
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?
Isn't the right configuration something like this?
{
"/alfresco": {
"target": "http://localhost:8080",
"secure": false,
"changeOrigin": true
}
}
Without the /share in the target parameter?
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
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
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?
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
?
I gave the links for SSL and Angular CLI at the beginning. Did you have a chance to investigate?
Discussions, help and advice about the Alfresco Development Framework.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.