Skip to content

Authentication times out when authenticating against liferay.com - works with www.liferay.com #10

@jamesfalkner

Description

@jamesfalkner

This times out (after about 1-2 minutes) and fails:

liferay_connector.authenticate('https://liferay.com', {
        login: username,
        password: password
    }, function (err, session) {
    }
}

But this works as expected:

liferay_connector.authenticate('https://www.liferay.com', {
        login: username,
        password: password
    }, function (err, session) {
    }
}

Notice the lack of www in the first one.

I did a bit of debugging and noticed that the HttpClient request in the first instance never completes, and eventually times out and returns this giant thing:

{
  "version": {
    "req": {
      "_query": [],
      "method": "POST",
      "url": "https://liferay.com/api/secure/jsonws/invoke",
      "header": {
        "Accept-Encoding": "",
        "Authorization": "Basic <<< redacted by jhf>>>",
        "User-Agent": "liferay-core-connector v0.8.1",
        "Content-Type": "application/json"
      },
      "_header": {
        "accept-encoding": "",
        "authorization": "Basic <<< redacted by jhf>>>",
        "user-agent": "liferay-core-connector v0.8.1",
        "content-type": "application/json"
      },
      "_callbacks": {
        "end": [
          null
        ],
        "error": [
          null
        ],
        "abort": [
          null
        ]
      },
      "_redirects": 0,
      "_data": {
        "/portal/get-build-number": {}
      },
      "xhr": {
        "autoRedirect": false,
        "method": "POST",
        "async": true,
        "url": "https://liferay.com/api/secure/jsonws/invoke"
      },
      "_finished": true
    },
    "xhr": {
      "autoRedirect": false,
      "method": "POST",
      "async": true,
      "url": "https://liferay.com/api/secure/jsonws/invoke"
    },
    "text": "The request timed out.",
    "status": 301,
    "statusType": 3,
    "info": false,
    "ok": false,
    "clientError": false,
    "serverError": false,
    "error": false,
    "accepted": false,
    "noContent": false,
    "badRequest": false,
    "unauthorized": false,
    "notAcceptable": false,
    "notFound": false,
    "forbidden": false,
    "headers": {
      "server": "Apache",
      "content-type": "text/html; charset=iso-8859-1",
      "location": "https://www.liferay.com/api/secure/jsonws/invoke",
      "strict-transport-security": "max-age=63072000; includeSubDomains",
      "keep-alive": "timeout=15, max=98",
      "date": "Fri, 14 Aug 2015 15:23:53 GMT",
      "content-length": "318",
      "cache-control": "max-age=604800"
    },
    "header": {
      "server": "Apache",
      "content-type": "text/html; charset=iso-8859-1",
      "location": "https://www.liferay.com/api/secure/jsonws/invoke",
      "strict-transport-security": "max-age=63072000; includeSubDomains",
      "keep-alive": "timeout=15, max=98",
      "date": "Fri, 14 Aug 2015 15:23:53 GMT",
      "content-length": "318",
      "cache-control": "max-age=604800"
    },
    "type": "text/html",
    "charset": "iso-8859-1",
    "body": null,
    "line": 800,
    "column": 14,
    "sourceURL": "file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js",
    "stack": "parseLiferayResponse@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:800:14\ntryCatch1@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:5980:25\nPromise$_callHandler@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:3478:22\nPromise$_settlePromiseFromHandler@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:3493:30\nPromise$_settlePromiseAt@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:3663:39\nPromise$_settlePromises@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:3806:30\nAsync$_consumeFunctionBuffer@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:1007:16\nAsync$consumeFunctionBuffer@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:970:36\nfile:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:6328:15"
  },
  "name": "UnrecognizedLiferayVersion",
  "message": "Cannot recognize liferay version [object Object]",
  "line": 559,
  "column": 53,
  "sourceURL": "file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js",
  "stack": "file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:559:53\ntryCatch1@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:5980:25\nPromise$_callHandler@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:3478:22\nPromise$_settlePromiseFromHandler@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:3493:30\nPromise$_settlePromiseAt@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:3663:39\nPromise$_settlePromises@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:3806:30\nPromise$_rejectPromises@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:3799:25\nAsync$_consumeFunctionBuffer@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:1007:16\nAsync$consumeFunctionBuffer@file:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:970:36\nfile:///Users/jhf/Library/Developer/CoreSimulator/Devices/D502B6D9-A5B6-4E88-B4D3-DE7698B17E2B/data/Containers/Bundle/Application/91426D90-C165-4851-9E93-F9E7E3DADB85/Liferay%20Events.app/liferay-connector.js:6328:15"
}

This is using Ti SDK 4.1.0, connector 0.8.1, in the iOS simulator

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions