3

I configured Chronograph to use generic OAuth 2.0 (using cloud foundry UAA). Users authentication works fine but the problem is that the default influxdb connection is not taken into consideration. In fact this configuration works:

chronograf  --log-level="debug" --resources-path="/usr/share/chronograf/resources" --influxdb-url="http://influxDB.log.database:8086" --influxdb-username="usename" --influxdb-password="pass"

here is the content of /usr/share/chronograf/resources folder:

influxdb.src:

{
  "id": "9999",
  "name": "MyInfluxDB",
  "username": "user1,
  "password": "password1",
  "url": "http://influxDB.log.database:8086",
  "type": "influx",
  "insecureSkipVerify": true,
  "default": true,
  "telegraf": "telegraf.autogen",
  "organization": "Default"
}

Both connections are automatically created when chronoraf starts :

but When I run chronograf with the following options (To use OAuth 2.0 and create an influxdb connection) :

export TOKEN_SECRET="token_secret"; export JWKS_URL="https://uaa/token_keys"; export PUBLIC_URL="http://chronograf:8888"; chronograf  --log-level="debug" --resources-path="/usr/share/chronograf/resources" --generic-name="generic" --generic-client-id="id" --generic-client-secret="secret" --generic-scopes="openid" --generic-auth-url="https://uaa/oauth/authorize" --generic-token-url="https://uaa/oauth/token" --generic-api-url="https://uaa/userinfo"

The OAuth 2.0 works fine but once redirected to the chronograf dashboard I cannot see the connections and even when I created a connection manually and I log in I cannot found any connection that is created automatically on startup as wanted.

1 Answers1

0

the field organization needs an id. The id for the Default orginization uses a lower case d. If you change your src file to,

{
  "id": "9999",
   "name": "MyInfluxDB",
   "username": "user1,
   "password": "password1",
   "url": "http://influxDB.log.database:8086",
   "type": "influx",
   "insecureSkipVerify": true,
   "default": true,
   "telegraf": "telegraf.autogen",
   "organization": "default"
}

It should now work.

you can see where the id is defined in their source here https://github.com/influxdata/chronograf/blob/9d8a49ba0ef8131cdce22d73718859f55f434db2/bolt/organizations.go#L20