You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Manages Grafana SSO Settings for OAuth2. SAML support will be added soon.
6
+
Manages Grafana SSO Settings for OAuth2 and SAML.
7
7
Official documentation https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/HTTP API https://grafana.com/docs/grafana/latest/developers/http_api/sso-settings/
8
8
---
9
9
10
10
# grafana_sso_settings (Resource)
11
11
12
-
Manages Grafana SSO Settings for OAuth2. SAML support will be added soon.
-`oauth2_settings` (Block Set, Min: 1, Max: 1) The SSO settings set. (see [below for nested schema](#nestedblock--oauth2_settings))
37
-
-`provider_name` (String) The name of the SSO provider. Supported values: github, gitlab, google, azuread, okta, generic_oauth.
36
+
-`provider_name` (String) The name of the SSO provider. Supported values: github, gitlab, google, azuread, okta, generic_oauth, saml.
37
+
38
+
### Optional
39
+
40
+
-`oauth2_settings` (Block Set, Max: 1) The OAuth2 settings set. Required for github, gitlab, google, azuread, okta, generic_oauth providers. (see [below for nested schema](#nestedblock--oauth2_settings))
41
+
-`saml_settings` (Block Set, Max: 1) The SAML settings set. Required for the saml provider. (see [below for nested schema](#nestedblock--saml_settings))
38
42
39
43
### Read-Only
40
44
@@ -87,6 +91,43 @@ Optional:
87
91
-`use_pkce` (Boolean) If enabled, Grafana will use Proof Key for Code Exchange (PKCE) with the OAuth2 Authorization Code Grant.
88
92
-`use_refresh_token` (Boolean) If enabled, Grafana will fetch a new access token using the refresh token provided by the OAuth2 provider.
89
93
94
+
95
+
<aid="nestedblock--saml_settings"></a>
96
+
### Nested Schema for `saml_settings`
97
+
98
+
Optional:
99
+
100
+
-`allow_idp_initiated` (Boolean) Whether SAML IdP-initiated login is allowed.
101
+
-`allow_sign_up` (Boolean) Whether to allow new Grafana user creation through SAML login. If set to false, then only existing Grafana users can log in with SAML.
102
+
-`allowed_organizations` (String) List of comma- or space-separated organizations. User should be a member of at least one organization to log in.
103
+
-`assertion_attribute_email` (String) Friendly name or name of the attribute within the SAML assertion to use as the user email.
104
+
-`assertion_attribute_groups` (String) Friendly name or name of the attribute within the SAML assertion to use as the user groups.
105
+
-`assertion_attribute_login` (String) Friendly name or name of the attribute within the SAML assertion to use as the user login handle.
106
+
-`assertion_attribute_name` (String) Friendly name or name of the attribute within the SAML assertion to use as the user name. Alternatively, this can be a template with variables that match the names of attributes within the SAML assertion.
107
+
-`assertion_attribute_org` (String) Friendly name or name of the attribute within the SAML assertion to use as the user organization.
108
+
-`assertion_attribute_role` (String) Friendly name or name of the attribute within the SAML assertion to use as the user roles.
109
+
-`auto_login` (Boolean) Whether SAML auto login is enabled.
110
+
-`certificate` (String, Sensitive) Base64-encoded string for the SP X.509 certificate.
111
+
-`certificate_path` (String) Path for the SP X.509 certificate.
112
+
-`enabled` (Boolean) Define whether this configuration is enabled for SAML. Defaults to `true`.
113
+
-`idp_metadata` (String) Base64-encoded string for the IdP SAML metadata XML.
114
+
-`idp_metadata_path` (String) Path for the IdP SAML metadata XML.
115
+
-`idp_metadata_url` (String) URL for the IdP SAML metadata XML.
116
+
-`max_issue_delay` (String) Duration, since the IdP issued a response and the SP is allowed to process it. For example: 90s, 1h.
117
+
-`metadata_valid_duration` (String) Duration, for how long the SP metadata is valid. For example: 48h, 5d.
118
+
-`name` (String) Name used to refer to the SAML authentication.
119
+
-`name_id_format` (String) The Name ID Format to request within the SAML assertion. Defaults to urn:oasis:names:tc:SAML:2.0:nameid-format:transient
120
+
-`org_mapping` (String) List of comma- or space-separated Organization:OrgId:Role mappings. Organization can be * meaning “All users”. Role is optional and can have the following values: Viewer, Editor or Admin.
121
+
-`private_key` (String, Sensitive) Base64-encoded string for the SP private key.
122
+
-`private_key_path` (String) Path for the SP private key.
123
+
-`relay_state` (String) Relay state for IdP-initiated login. Should match relay state configured in IdP.
124
+
-`role_values_admin` (String) List of comma- or space-separated roles which will be mapped into the Admin role.
125
+
-`role_values_editor` (String) List of comma- or space-separated roles which will be mapped into the Editor role.
126
+
-`role_values_grafana_admin` (String) List of comma- or space-separated roles which will be mapped into the Grafana Admin (Super Admin) role.
127
+
-`role_values_none` (String) List of comma- or space-separated roles which will be mapped into the None role.
128
+
-`signature_algorithm` (String) Signature algorithm used for signing requests to the IdP. Supported values are rsa-sha1, rsa-sha256, rsa-sha512.
129
+
-`single_logout` (Boolean) Whether SAML Single Logout is enabled.
Description: "The OAuth2 settings set. Required for github, gitlab, google, azuread, okta, generic_oauth providers.",
55
+
Elem: oauth2SettingsSchema,
56
+
ConflictsWith: []string{samlSettingsKey},
57
+
},
58
+
samlSettingsKey: {
59
+
Type: schema.TypeSet,
60
+
Optional: true,
61
+
MaxItems: 1,
62
+
MinItems: 0,
63
+
Description: "The SAML settings set. Required for the saml provider.",
64
+
Elem: samlSettingsSchema,
65
+
ConflictsWith: []string{oauth2SettingsKey},
55
66
},
56
67
},
57
68
}
@@ -263,6 +274,164 @@ var oauth2SettingsSchema = &schema.Resource{
263
274
},
264
275
}
265
276
277
+
varsamlSettingsSchema=&schema.Resource{
278
+
Schema: map[string]*schema.Schema{
279
+
"enabled": {
280
+
Type: schema.TypeBool,
281
+
Optional: true,
282
+
Default: true,
283
+
Description: "Define whether this configuration is enabled for SAML.",
284
+
},
285
+
"name": {
286
+
Type: schema.TypeString,
287
+
Optional: true,
288
+
Description: "Name used to refer to the SAML authentication.",
289
+
},
290
+
"single_logout": {
291
+
Type: schema.TypeBool,
292
+
Optional: true,
293
+
Description: "Whether SAML Single Logout is enabled.",
294
+
},
295
+
"allow_sign_up": {
296
+
Type: schema.TypeBool,
297
+
Optional: true,
298
+
Description: "Whether to allow new Grafana user creation through SAML login. If set to false, then only existing Grafana users can log in with SAML.",
299
+
},
300
+
"auto_login": {
301
+
Type: schema.TypeBool,
302
+
Optional: true,
303
+
Description: "Whether SAML auto login is enabled.",
304
+
},
305
+
"allow_idp_initiated": {
306
+
Type: schema.TypeBool,
307
+
Optional: true,
308
+
Description: "Whether SAML IdP-initiated login is allowed.",
309
+
},
310
+
"certificate": {
311
+
Type: schema.TypeString,
312
+
Optional: true,
313
+
Sensitive: true,
314
+
Description: "Base64-encoded string for the SP X.509 certificate.",
315
+
},
316
+
"certificate_path": {
317
+
Type: schema.TypeString,
318
+
Optional: true,
319
+
Description: "Path for the SP X.509 certificate.",
320
+
},
321
+
"private_key": {
322
+
Type: schema.TypeString,
323
+
Optional: true,
324
+
Sensitive: true,
325
+
Description: "Base64-encoded string for the SP private key.",
326
+
},
327
+
"private_key_path": {
328
+
Type: schema.TypeString,
329
+
Optional: true,
330
+
Description: "Path for the SP private key.",
331
+
},
332
+
"signature_algorithm": {
333
+
Type: schema.TypeString,
334
+
Optional: true,
335
+
Description: "Signature algorithm used for signing requests to the IdP. Supported values are rsa-sha1, rsa-sha256, rsa-sha512.",
336
+
},
337
+
"idp_metadata": {
338
+
Type: schema.TypeString,
339
+
Optional: true,
340
+
Description: "Base64-encoded string for the IdP SAML metadata XML.",
341
+
},
342
+
"idp_metadata_path": {
343
+
Type: schema.TypeString,
344
+
Optional: true,
345
+
Description: "Path for the IdP SAML metadata XML.",
346
+
},
347
+
"idp_metadata_url": {
348
+
Type: schema.TypeString,
349
+
Optional: true,
350
+
Description: "URL for the IdP SAML metadata XML.",
351
+
},
352
+
"max_issue_delay": {
353
+
Type: schema.TypeString,
354
+
Optional: true,
355
+
Description: "Duration, since the IdP issued a response and the SP is allowed to process it. For example: 90s, 1h.",
356
+
},
357
+
"metadata_valid_duration": {
358
+
Type: schema.TypeString,
359
+
Optional: true,
360
+
Description: "Duration, for how long the SP metadata is valid. For example: 48h, 5d.",
361
+
},
362
+
"relay_state": {
363
+
Type: schema.TypeString,
364
+
Optional: true,
365
+
Description: "Relay state for IdP-initiated login. Should match relay state configured in IdP.",
366
+
},
367
+
"assertion_attribute_name": {
368
+
Type: schema.TypeString,
369
+
Optional: true,
370
+
Description: "Friendly name or name of the attribute within the SAML assertion to use as the user name. Alternatively, this can be a template with variables that match the names of attributes within the SAML assertion.",
371
+
},
372
+
"assertion_attribute_login": {
373
+
Type: schema.TypeString,
374
+
Optional: true,
375
+
Description: "Friendly name or name of the attribute within the SAML assertion to use as the user login handle.",
376
+
},
377
+
"assertion_attribute_email": {
378
+
Type: schema.TypeString,
379
+
Optional: true,
380
+
Description: "Friendly name or name of the attribute within the SAML assertion to use as the user email.",
381
+
},
382
+
"assertion_attribute_groups": {
383
+
Type: schema.TypeString,
384
+
Optional: true,
385
+
Description: "Friendly name or name of the attribute within the SAML assertion to use as the user groups.",
386
+
},
387
+
"assertion_attribute_role": {
388
+
Type: schema.TypeString,
389
+
Optional: true,
390
+
Description: "Friendly name or name of the attribute within the SAML assertion to use as the user roles.",
391
+
},
392
+
"assertion_attribute_org": {
393
+
Type: schema.TypeString,
394
+
Optional: true,
395
+
Description: "Friendly name or name of the attribute within the SAML assertion to use as the user organization.",
396
+
},
397
+
"allowed_organizations": {
398
+
Type: schema.TypeString,
399
+
Optional: true,
400
+
Description: "List of comma- or space-separated organizations. User should be a member of at least one organization to log in.",
401
+
},
402
+
"org_mapping": {
403
+
Type: schema.TypeString,
404
+
Optional: true,
405
+
Description: "List of comma- or space-separated Organization:OrgId:Role mappings. Organization can be * meaning “All users”. Role is optional and can have the following values: Viewer, Editor or Admin.",
406
+
},
407
+
"role_values_none": {
408
+
Type: schema.TypeString,
409
+
Optional: true,
410
+
Description: "List of comma- or space-separated roles which will be mapped into the None role.",
411
+
},
412
+
"role_values_editor": {
413
+
Type: schema.TypeString,
414
+
Optional: true,
415
+
Description: "List of comma- or space-separated roles which will be mapped into the Editor role.",
416
+
},
417
+
"role_values_admin": {
418
+
Type: schema.TypeString,
419
+
Optional: true,
420
+
Description: "List of comma- or space-separated roles which will be mapped into the Admin role.",
421
+
},
422
+
"role_values_grafana_admin": {
423
+
Type: schema.TypeString,
424
+
Optional: true,
425
+
Description: "List of comma- or space-separated roles which will be mapped into the Grafana Admin (Super Admin) role.",
426
+
},
427
+
"name_id_format": {
428
+
Type: schema.TypeString,
429
+
Optional: true,
430
+
Description: "The Name ID Format to request within the SAML assertion. Defaults to urn:oasis:names:tc:SAML:2.0:nameid-format:transient",
0 commit comments