-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
service_principal: Support the
saml_single_sign_on
block with the `…
…relay_state` property (resource and data source)
- Loading branch information
1 parent
6cac1e0
commit d057983
Showing
7 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package serviceprincipals | ||
|
||
import ( | ||
"github.com/manicminer/hamilton/msgraph" | ||
|
||
"github.com/hashicorp/terraform-provider-azuread/internal/utils" | ||
) | ||
|
||
func expandSamlSingleSignOn(in []interface{}) *msgraph.SamlSingleSignOnSettings { | ||
result := msgraph.SamlSingleSignOnSettings{} | ||
if len(in) == 0 || in[0] == nil { | ||
return &result | ||
} | ||
|
||
samlSingleSignOnSettings := in[0].(map[string]interface{}) | ||
|
||
result.RelayState = utils.String(samlSingleSignOnSettings["relay_state"].(string)) | ||
|
||
return &result | ||
} | ||
|
||
func flattenSamlSingleSignOn(in *msgraph.SamlSingleSignOnSettings) []map[string]interface{} { | ||
if in == nil { | ||
return []map[string]interface{}{} | ||
} | ||
|
||
relayState := "" | ||
if in.RelayState != nil { | ||
relayState = *in.RelayState | ||
} | ||
|
||
return []map[string]interface{}{{ | ||
"relay_state": relayState, | ||
}} | ||
} |