Portals

What is Portals?

Please see Exosite Portals and One Platform Documentation.

What Portals service does

Portals service supports the following Portals API currently.

Quickstart

Add Portals service to your Business

Subscribe to Portals service in Exchange for your Business. If you are not familiar with Murano’s Exchange Element, you can refer to this doc: Adding Exchange Elements.

Configure Portals service

Configure Portals service

It's required to configure Portals host to use the Portals service in a Lua script.

  1. Click SOLUTIONS in the top navigation bar and choose your Application Solution.
  2. Click the Services item in the left menu.
  3. Click Portals in the service list.
  4. Input your portals host e.g. "portalsdemo.exosite.com".
  5. Click APPLY.

You should be able to start using the Portals Service APIs in your application solution. Below we provide an example to use this service.

Example using Portals service

Below we present a Murano application solution endpoint example to demostrate how to use this service. Assumption is made that the readers already have some level of knowledge of Portals. Make sure you have already configured the "host" info in the service configuration of your Murano application solution (see last section for instructions). The credentials used below are for demostration purpose only, you should use valid Portals credentials instead when following this example.

Create an Endpoint to use the Portals service

This step adds a new solution endpoint to use Portals service APIs.

Create Endpoint

  1. Click Endpoints.
  2. Click + NEW ENDPOINT.

    Endpoint Popup

  3. Select POST from Select Method.

  4. Fill portals in Path.
  5. Click CREATE.

    Save Endpoint

  6. Paste the following in the code editor:

    local token = Portals.getUserToken({
        email = request.body.email,
        password = request.body.password
    })
    if token.error ~= nil then
        local err = nil
        if token.status == 403 then
            err = 'Email does not exist or password is incorrect'
        elseif token.status == 404 then
            err = 'Host does not exist in Portal'
        else
            err = 'Failed getUserToken'
        end
        return { err,  request, token }
    end
    
    local info = Portals.getUserInfo({
        token = token
    })
    if info.error ~= nil then
        return { 'Failed getUserInfo', { token = token }, info }
    end
    
    return { info = info, token = token }
    
  7. Click SAVE.

Request the Endpoint to use the Portals service

This step verifies the endpoint created in the previous step.

Now go to your terminal and run the following command:

curl -H'content-type:application/json' \
  https://portalsdemo.apps.exosite.io/portals \
  -d'{"email":"portalsdemo@example.com","password":"portalsdemo"}'

The response should look like:

{
  "info": {
    "activated": true,
    "email": "portalsdemo@example.com",
    "fullName": "Portals Demo",
    "groups": [],
    "id": "9876543210",
    "permissions": [],
    "phoneNumber": "",
    "rid": "fedcba9876543210fedcba9876543210fedcba98",
    "userName": "portalsdemo"
  },
  "token":
    "W5FnYt-VxARkum2e0LOJDFb8FF5-qHaNZrTEMPvTwMPaVDxq3JAWGCYiRU3DhXFQ_-8fdyJlB5LK9oZfbm8oToXlNpPp"
}

Debug

Email does not exist or password is incorrect

If you see similar response to the following response. It means the request to get user token has failed because the email doesn't exist or the password is incorrect.

[
  "Email does not exist or password is incorrect",
  {
    "body": {
      "email": "portalsdemo@exosite.com",
      "password": "portalsdemo"
    },
    "files": [],
    "headers": {
      "accept": "*/*",
      "content-length": "125",
      "content-type": "application/json",
      "forwarded":
        "for=10.133.218.2;host=portalsdemo.apps.exosite.io;proto=https",
      "host": "portalsdemo.apps.exosite.io",
      "user-agent": "curl/7.54.0",
      "user_agent": "curl/7.54.0",
      "x-forwarded-for": "10.133.218.2",
      "x-forwarded-host": "portalsdemo.apps.exosite.io",
      "x-forwarded-port": "443",
      "x-forwarded-proto": "https"
    },
    "method": "POST",
    "parameters": {},
    "request_id": "bbabciadbabg-k2vxg6i971tk00000-04a3d45a",
    "route": "/portals",
    "solution_id": "v2vxg6i971tk00000",
    "timestamp": 1.512461461986e12,
    "uri": "https://portalsdemo.apps.exosite.io/portals"
  },
  {
    "error": "Forbidden",
    "status": 403,
    "type": "QueryError"
  }
]

Verify the credentials you provided was correct by going to the portals domain set in the service config, and try to login using the email and password in your curl request to login. Make sure you can login to Portals with the same credential, if you can login there, please connect Murano Support.

Host does not exist in Portal

If you see similar response to the following response. It means the request to get user token has failed because host in service config does not exist.

[
  "Host does not exist in Portal",
  {
    "body": {
      "email": "portalsdemo@exosite.com",
      "password": "portalsdemo"
    },
    "files": [],
    "headers": {
      "accept": "*/*",
      "content-length": "125",
      "content-type": "application/json",
      "forwarded":
        "for=10.133.218.2;host=portalsdemo.apps.exosite.io;proto=https",
      "host": "portalsdemo.apps.exosite.io",
      "user-agent": "curl/7.54.0",
      "user_agent": "curl/7.54.0",
      "x-forwarded-for": "10.133.218.2",
      "x-forwarded-host": "portalsdemo.apps.exosite.io",
      "x-forwarded-port": "443",
      "x-forwarded-proto": "https"
    },
    "method": "POST",
    "parameters": {},
    "request_id": "bbabciadbabg-k2vxg6i971tk00000-6e94453e",
    "route": "/portals",
    "solution_id": "v2vxg6i971tk00000",
    "timestamp": 1.512461679092e12,
    "uri": "https://portalsdemo.apps.exosite.io/portals"
  },
  {
    "error": "Domain Not Found",
    "status": 404,
    "type": "QueryError"
  }
]

Failed getUserToken

If you see similar response to the following response. It means you run into a catch all block. There is nothing you can do. Please contact Murano Support.

[
  "Failed getUserToken",
  {
    "body": {
      "email": "portalsdemo@exosite.com",
      "password": "portalsdemo"
    },
    "files": [],
    "headers": {
      "accept": "*/*",
      "content-length": "125",
      "content-type": "application/json",
      "forwarded":
        "for=10.133.218.2;host=portalsdemo.apps.exosite.io;proto=https",
      "host": "portalsdemo.apps.exosite.io",
      "user-agent": "curl/7.54.0",
      "user_agent": "curl/7.54.0",
      "x-forwarded-for": "10.133.218.2",
      "x-forwarded-host": "portalsdemo.apps.exosite.io",
      "x-forwarded-port": "443",
      "x-forwarded-proto": "https"
    },
    "method": "POST",
    "parameters": {},
    "request_id": "bbabciadbabg-k2vxg6i971tk00000-6e94453e",
    "route": "/portals",
    "solution_id": "v2vxg6i971tk00000",
    "timestamp": 1.512461679092e12,
    "uri": "https://portalsdemo.apps.exosite.io/portals"
  },
  {
    "error": "Domain Not Found",
    "status": 404,
    "type": "QueryError"
  }
]

Failed getUserInfo

If you see similar response to the following response. It means you run into a catch all block. There is nothing you can do. Please contact Murano Support.

[
  "Failed getUserInfo",
  {
    "token":
      "dc3vZz2RB94KM1jMC9ieawLs4wfBN9YizgQ5Rc2Vg7hT2uy_0A_XS_NTqwXrKCZ0dpYHnlYVR0YZ9pX2bKZHaHNJksLE"
  },
  {
    "error": "Not Found",
    "status": 404,
    "type": "QueryError"
  }
]