Skip to content

Commit

Permalink
Merge pull request #80 from auth0/patch/show-as-button
Browse files Browse the repository at this point in the history
Add ShowAsButton option for enterprise connections
  • Loading branch information
sergiught authored Mar 4, 2022
2 parents 1c60a83 + 6950903 commit 81c4641
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 57 deletions.
17 changes: 16 additions & 1 deletion auth0/resource_auth0_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

func newConnection() *schema.Resource {
return &schema.Resource{

Create: createConnection,
Read: readConnection,
Update: updateConnection,
Expand Down Expand Up @@ -665,6 +664,11 @@ var connectionSchema = map[string]*schema.Schema{
Computed: true,
Description: "Defines the realms for which the connection will be used (i.e., email domains). If not specified, the connection name is added as the realm",
},
"show_as_button": {
Type: schema.TypeBool,
Optional: true,
Description: "Display connection as a button. Only available on enterprise connections.",
},
}

func connectionSchemaV0() *schema.Resource {
Expand Down Expand Up @@ -788,6 +792,17 @@ func readConnection(d *schema.ResourceData, m interface{}) error {
d.Set("options", flattenConnectionOptions(d, c.Options))
d.Set("enabled_clients", c.EnabledClients)
d.Set("realms", c.Realms)

switch *c.Strategy {
case management.ConnectionStrategyGoogleApps,
management.ConnectionStrategyOIDC,
management.ConnectionStrategyAD,
management.ConnectionStrategyAzureAD,
management.ConnectionStrategySAML,
management.ConnectionStrategyADFS:
d.Set("show_as_button", c.ShowAsButton)
}

return nil
}

Expand Down
Loading

0 comments on commit 81c4641

Please sign in to comment.