Skip to content

Bindaas Admin Guide

Pradeeban Kathiravelu edited this page Jul 26, 2018 · 7 revisions

In this page, we discuss the common administration tasks related to Bindaas in detail.

How to disable Bindaas authentication?

If you like to turn off the use of api keys to consume the Bindaas services, you can easily turn them off from the bin/bindaas.config.json as below:

"enableAuthentication": false,

With the authentication enabled, a valid query for a service will be as below:

curl http://localhost:9099/services/test/mongo/query/find?api_key=d9076d81-147d-44c3-9af6-d3dc5d9f204wb

A query such as the below without the api_key will fail when the authentication is enabled, whereas it will succeed when the authentication is disabled.

curl http://localhost:9099/services/test/mongo/query/find

You may delegate the authentication to an API Gateway while disabling the authentication from Bindaas.

In such case, the api_key in the below query will rather be validated by the API gateway external to Bindaas, and not be Bindaas itself.

curl http://localhost:9099/services/test/mongo/query/find?api_key=d9076d81-147d-44c3-9af6-d3dc5d9f204wb

How to configure Bindaas with Kong API Gateway for its authentication?

Here we will look into configuring Kong using the Docker containers.

Configure Kong with Postgres and Apache DS

First get the Sharmalab's kong-ldap repository:

$ git clone https://github.com/sharmalab/kong-ldap.git

Now run the buildRun script:

$ cd kong-ldap

$ sh buildRun.sh

Configure Bindaas with Kong

To configure the services:

$ curl -i -X POST --url http://127.0.0.1:8001/apis/ --data 'name=bindaxy' --data 'hosts=bindaxy.com' --data 'upstream_url=http://docker.for.mac.host.internal:9099'

If neither Bindaas nor Kong is configured with authentication, you may call the api without using an api_key as shown below:

curl -i -X GET --url http://127.0.0.1:8000/services/test/mongo/query/find --header 'Host: bindaxy.com'

If Bindaas is configured with the authentication, provide the api_key generated by Bindaas for a user accordingly.

$ curl -i -X GET --url http://127.0.0.1:8000/services/test/mongo/query/find?api_key=d9076d81-147d-44c3-9af6-d3dc5d9f204b --header 'Host: bindaxy.com'

To configure the dashboard:

$ curl -i -X POST --url http://127.0.0.1:8001/apis/ --data 'name=bindax' --data 'hosts=bindax.com' --data 'upstream_url=http://docker.for.mac.host.internal:8080'

$ curl -i -X GET --url http://127.0.0.1:8000/dashboard/ --header 'Host: bindax.com'

The above commands are for Docker for Mac.

Replace "docker.for.mac.host.internal" in the above commands with "host.docker.internal" for Docker environments other than "Docker for Mac"

How to change the admin dashboard port from 8080 to something else?

You have two options.

i) Pass the new port as an argument:

java -Dorg.osgi.service.http.port=8082 -Djava.net.preferIPv4Stack=true -Dpid=BINDAAS_INSTANCE -Xmx1024m -jar org.eclipse.osgi_3.8.2.v20130124-134944.jar -console

ii) Change the below line in bin/config.ini from 8080 to something else:

org.osgi.service.http.port=8081

If both (i) and (ii) are configured, the input in the console argument takes precedence. i.e., the dashboard uses the port 8082 above.

Clone this wiki locally