cancel
Showing results for 
Search instead for 
Did you mean: 

Error with login to ADF

udayakumar_p
Confirmed Champ
Confirmed Champ

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.

1 ACCEPTED ANSWER

douglascrp
World-Class Innovator
World-Class Innovator

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 

View answer in original post

14 REPLIES 14

dvuika
Star Collaborator
Star Collaborator

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 

dvuika
Star Collaborator
Star Collaborator

udayakumar_p
Confirmed Champ
Confirmed Champ

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?

douglascrp
World-Class Innovator
World-Class Innovator

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?