diff --git a/public/app/plugins/datasource/stackdriver/config_ctrl.ts b/public/app/plugins/datasource/stackdriver/config_ctrl.ts
index d3847562156..13dba26ba86 100644
--- a/public/app/plugins/datasource/stackdriver/config_ctrl.ts
+++ b/public/app/plugins/datasource/stackdriver/config_ctrl.ts
@@ -5,13 +5,23 @@ export class StackdriverConfigCtrl {
jsonText: string;
validationErrors: string[] = [];
inputDataValid: boolean;
+ authenticationTypes: any[];
+ defaultAuthenticationType: string;
/** @ngInject */
constructor(datasourceSrv) {
+ this.defaultAuthenticationType = 'jwt';
this.datasourceSrv = datasourceSrv;
this.current.jsonData = this.current.jsonData || {};
+ this.current.jsonData.authenticationType = this.current.jsonData.authenticationType
+ ? this.current.jsonData.authenticationType
+ : this.defaultAuthenticationType;
this.current.secureJsonData = this.current.secureJsonData || {};
this.current.secureJsonFields = this.current.secureJsonFields || {};
+ this.authenticationTypes = [
+ { key: this.defaultAuthenticationType, value: 'Google JWT File' },
+ { key: 'gce', value: 'Use GCE default Authentication' },
+ ];
}
save(jwt) {
@@ -67,7 +77,7 @@ export class StackdriverConfigCtrl {
this.inputDataValid = false;
this.jsonText = '';
- this.current.jsonData = {};
+ this.current.jsonData = Object.assign({}, { authenticationType: this.current.jsonData.authenticationType });
this.current.secureJsonData = {};
this.current.secureJsonFields = {};
}
diff --git a/public/app/plugins/datasource/stackdriver/partials/config.html b/public/app/plugins/datasource/stackdriver/partials/config.html
index 6fd52a898f5..0cc08a3e9d8 100644
--- a/public/app/plugins/datasource/stackdriver/partials/config.html
+++ b/public/app/plugins/datasource/stackdriver/partials/config.html
@@ -31,10 +31,16 @@
contents will be encrypted and saved in the Grafana database.
-
Do not forget to save your changes after uploading a file.
+Do not forget to - -
+ Verify GCE automatic authentication by clicking Save & Test