Can't login after Creation

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner

Can't login after Creation

I have a virtual machine with Ubuntu on it. There my Alfresco Content System is running. 

On my host system (MacOS) I can access the share application with the right IP address in the Browser.

Now I created a new ADF application on my host system. Everything alright. I changed the proxy.conf.json to point the  "/alfresco" to my IP address and port (http://192.168.52.10:8080).

So when I start the System I see the application but I can't login. I get invalid username/password.

However when I look into the Network tab I see that the ticket request is aborted after some time. Also the Url points to the localhost:4200 and not to my IP address.

 

7 Replies
Highlighted
Alfresco Employee

Re: Can't login after Creation

Hi,

Few questions:

  1. Which alfresco Content service version do you have?
  2. Could you post your app.config.json
  3. Could you post your proxy.conf.js?
Highlighted
Partner

Re: Can't login after Creation

I now changed it in the app.config.json didn't notice the ecmHost value. However it still wont work, even though the Network Request now points to the correct URL.

1. Alfresco 5.1

2. app.config.json

{
    "$schema": "../node_modules/@alfresco/adf-core/app.config.schema.json",
    "ecmHost": "http://192.168.52.10",
    "bpmHost": "http://{hostname}{:port}",
    "application": {
        "name": "Alfresco ADF Appplication"
    },
    "languages": [
        {
            "key": "en",
            "label": "English"
        },
        {
            "key": "fr",
            "label": "French"
        },
        {
            "key": "de",
            "label": "German"
        },
        {
            "key": "it",
            "label": "Italian"
        },
        {
            "key": "es",
            "label": "Spanish"
        },
        {
            "key": "ja",
            "label": "Japanese"
        },
        {
            "key": "nl",
            "label": "Dutch"
        },
        {
            "key": "pt-BR",
            "label": "Brazilian Portuguese"
        },
        {
            "key": "nb",
            "label": "Norwegian"
        },
        {
            "key": "ru",
            "label": "Russian"
        },
        {
            "key": "zh-CN",
            "label": "Simplified Chinese"
        }
    ],
    "logLevel" : "trace"
}

3. proxy.conf.json

{
  "/alfresco": {
    "target": "http://192.168.52.10:8080",
    "secure": false,
    "changeOrigin": true
  }
}
Highlighted
Alfresco Employee

Re: Can't login after Creation

Proxy and webpack-dev-server must be used only during development. Are you trying to setup production environment with that?

Highlighted
Partner

Re: Can't login after Creation

No I only just started trying out the ADF and play around a bit with it locally.

Highlighted
Alfresco Employee

Re: Can't login after Creation

Leave the app.config.json unedited. The proxy config we have redirects all calls to "/alfresco/*" from the same address the app is running to the proxied address. In your case you change both and then proxy the content that is already coming from the final address.

Highlighted
Partner

Re: Can't login after Creation

I don't know if I understand you correctly. As I said before, i have left the app.config.json unedited and tried with the proxy.conf.json . However there the request wasnt sent to 192.168.52.10 but to localhost. And the main problem is, that the request seems to timeout with both addresses.

Highlighted
Alfresco Employee

Re: Can't login after Creation

Hi Marius, 

In order to avoid CORS problem, you need to send the request to the same address where the client application exists.

Is completely fine send the request to your localhost.

Form this point on when you request reach your localhost server where the webpack dev server is up the proxy should take care of this call and redirect it to the right address. 

So it should be:

Client Application (API CALL)  ---> request hit webpack server localhost:4200 --> webpack proxy intercept the call --> The call will be redirected to the right IP server.

If you don't want to configure all this CORS skip strategy you can disable it on the server but is not a good practice.

I suggest you give a look also to this article:

https://community.alfresco.com/community/application-development-framework/blog/2017/06/20/adf-cors-...