Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

added grant_type support to client resource #22

Merged
merged 2 commits into from
Jul 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions auth0/resource_auth0_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ func newClient() *schema.Resource {
Elem: &schema.Schema{Type: schema.TypeString},
Optional: true,
},
"grant_types": {
Type: schema.TypeList,
Elem: &schema.Schema{Type: schema.TypeString},
Computed: true,
Optional: true,
},
"allowed_origins": {
Type: schema.TypeList,
Elem: &schema.Schema{Type: schema.TypeString},
Expand Down Expand Up @@ -231,6 +237,7 @@ func readClient(d *schema.ResourceData, m interface{}) error {
d.Set("callbacks", c.Callbacks)
d.Set("allowed_logout_urls", c.AllowedLogoutURLs)
d.Set("allowed_origins", c.AllowedOrigins)
d.Set("grant_types", c.GrantTypes)
d.Set("web_origins", c.WebOrigins)
d.Set("sso", c.SSO)
d.Set("sso_disabled", c.SSODisabled)
Expand Down Expand Up @@ -294,6 +301,7 @@ func buildClient(d *schema.ResourceData) *management.Client {
Callbacks: d.Get("callbacks").([]interface{}),
AllowedLogoutURLs: d.Get("allowed_logout_urls").([]interface{}),
AllowedOrigins: d.Get("allowed_origins").([]interface{}),
GrantTypes: d.Get("grant_types").([]interface{}),
WebOrigins: d.Get("web_origins").([]interface{}),
SSO: d.Get("sso").(bool),
SSODisabled: d.Get("sso_disabled").(bool),
Expand Down
1 change: 1 addition & 0 deletions auth0/resource_auth0_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ resource "auth0_client" "my_client" {
oidc_conformant = false
callbacks = [ "https://example.com/callback" ]
allowed_origins = [ "https://example.com" ]
grant_types = [ "authorization_code", "http://auth0.com/oauth/grant-type/password-realm", "implicit", "password", "refresh_token" ]
allowed_logout_urls = [ "https://example.com" ]
web_origins = [ "https://example.com" ]
jwt_configuration = {
Expand Down
11 changes: 6 additions & 5 deletions example/client/main.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
provider "auth0" {}

resource "auth0_client" "my_app_client" {
name = "Example Penis Application (Managed by Terraform)"
description = "Example Penis Application Loooooong Description"
name = "Example Application (Managed by Terraform)"
description = "Example Application Loooooong Description"
app_type = "non_interactive"
is_first_party = true
oidc_conformant = false
callbacks = ["https://peni.com/callback"]
allowed_origins = ["https://peni.com"]
web_origins = ["https://peni.com"]
callbacks = ["https://example.com/callback"]
allowed_origins = ["https://example.com"]
web_origins = ["https://example.com"]
grant_types = [ "authorization_code", "http://auth0.com/oauth/grant-type/password-realm", "implicit", "password", "refresh_token" ]

jwt_configuration = {
lifetime_in_seconds = 120
Expand Down