// This is an automatically generated code sample.
// To make this code sample work in your Oracle Cloud tenancy,
// please replace the values for any parameters whose current values do not fit
// your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
// boolean, number, and enum parameters with values not fitting your use case).
package main
import (
"context"
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"github.com/oracle/oci-go-sdk/v65/example/helpers"
"github.com/oracle/oci-go-sdk/v65/identitydomains"
)
func ExampleCreateIdentityProvider() {
// Create a default authentication provider that uses the DEFAULT
// profile in the configuration file.
// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
client, err := identitydomains.NewIdentityDomainsClientWithConfigurationProvider(common.DefaultConfigProvider(), "specificEndpoint")
helpers.FatalIfError(err)
// Create a request and dependent object(s).
req := identitydomains.CreateIdentityProviderRequest{AttributeSets: []identitydomains.AttributeSetsEnum{identitydomains.AttributeSetsNever},
Attributes: common.String("EXAMPLE-attributes-Value"),
Authorization: common.String("EXAMPLE-authorization-Value"),
IdentityProvider: identitydomains.IdentityProvider{JitUserProvGroupMappingMode: identitydomains.IdentityProviderJitUserProvGroupMappingModeExplicit,
NameIdFormat: common.String("EXAMPLE-nameIdFormat-Value"),
PartnerName: common.String("EXAMPLE-partnerName-Value"),
SignatureHashAlgorithm: identitydomains.IdentityProviderSignatureHashAlgorithm256,
SigningCertificate: common.String("EXAMPLE-signingCertificate-Value"),
UrnIetfParamsScimSchemasOracleIdcsExtensionSocialIdentityProvider: &identitydomains.ExtensionSocialIdentityProvider{AccessTokenUrl: common.String("EXAMPLE-accessTokenUrl-Value"),
ClockSkewInSeconds: common.Int(338),
Scope: []string{"EXAMPLE--Value"},
AccountLinkingEnabled: common.Bool(true),
AdminScope: []string{"EXAMPLE--Value"},
AuthzUrl: common.String("EXAMPLE-authzUrl-Value"),
AutoRedirectEnabled: common.Bool(true),
IdAttribute: common.String("EXAMPLE-idAttribute-Value"),
RelayIdpParamMappings: []identitydomains.IdentityProviderRelayIdpParamMappings{identitydomains.IdentityProviderRelayIdpParamMappings{RelayParamKey: common.String("EXAMPLE-relayParamKey-Value"),
RelayParamValue: common.String("EXAMPLE-relayParamValue-Value")}},
Status: identitydomains.ExtensionSocialIdentityProviderStatusDeleted,
JitProvAssignedGroups: []identitydomains.IdentityProviderJitProvAssignedGroups{identitydomains.IdentityProviderJitProvAssignedGroups{Ref: common.String("EXAMPLE-$ref-Value"),
Display: common.String("EXAMPLE-display-Value"),
Value: common.String("EXAMPLE-value-Value")}},
JitProvGroupStaticListEnabled: common.Bool(false),
ProfileUrl: common.String("EXAMPLE-profileUrl-Value"),
RedirectUrl: common.String("EXAMPLE-redirectUrl-Value"),
RegistrationEnabled: common.Bool(false),
ServiceProviderName: common.String("EXAMPLE-serviceProviderName-Value"),
SocialJitProvisioningEnabled: common.Bool(true),
ClientCredentialInPayload: common.Bool(true),
ConsumerKey: common.String("EXAMPLE-consumerKey-Value"),
ConsumerSecret: common.String("EXAMPLE-consumerSecret-Value"),
DiscoveryUrl: common.String("EXAMPLE-discoveryUrl-Value")},
IdpSsoUrl: common.String("EXAMPLE-idpSsoUrl-Value"),
JitUserProvGroupStaticListEnabled: common.Bool(true),
AssertionAttribute: common.String("EXAMPLE-assertionAttribute-Value"),
Description: common.String("EXAMPLE-description-Value"),
LastNotificationSentTime: common.String("EXAMPLE-lastNotificationSentTime-Value"),
LogoutRequestUrl: common.String("EXAMPLE-logoutRequestUrl-Value"),
ServiceInstanceIdentifier: common.String("EXAMPLE-serviceInstanceIdentifier-Value"),
Id: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value"),
Metadata: common.String("EXAMPLE-metadata-Value"),
SuccinctId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-succinctId-Value"),
CompartmentOcid: common.String("EXAMPLE-compartmentOcid-Value"),
EncryptionCertificate: common.String("EXAMPLE-encryptionCertificate-Value"),
JitUserProvAttributeUpdateEnabled: common.Bool(true),
JitUserProvGroupSAMLAttributeName: common.String("EXAMPLE-jitUserProvGroupSAMLAttributeName-Value"),
PartnerProviderId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-partnerProviderId-Value"),
IdcsLastUpgradedInRelease: common.String("EXAMPLE-idcsLastUpgradedInRelease-Value"),
JitUserProvGroupMappings: []identitydomains.IdentityProviderJitUserProvGroupMappings{identitydomains.IdentityProviderJitUserProvGroupMappings{Value: common.String("EXAMPLE-value-Value"),
Ref: common.String("EXAMPLE-$ref-Value"),
IdpGroup: common.String("EXAMPLE-idpGroup-Value")}},
ShownOnLoginPage: common.Bool(false),
JitUserProvEnabled: common.Bool(true),
LogoutResponseUrl: common.String("EXAMPLE-logoutResponseUrl-Value"),
RequireForceAuthn: common.Bool(true),
TenancyOcid: common.String("EXAMPLE-tenancyOcid-Value"),
AuthnRequestBinding: identitydomains.IdentityProviderAuthnRequestBindingRedirect,
Ocid: common.String("EXAMPLE-ocid-Value"),
CorrelationPolicy: &identitydomains.IdentityProviderCorrelationPolicy{Ref: common.String("EXAMPLE-$ref-Value"),
Display: common.String("EXAMPLE-display-Value"),
Type: identitydomains.IdentityProviderCorrelationPolicyTypePolicy,
Value: common.String("EXAMPLE-value-Value")},
IdcsCreatedBy: &identitydomains.IdcsCreatedBy{Ocid: common.String("EXAMPLE-ocid-Value"),
Type: identitydomains.IdcsCreatedByTypeUser,
Value: common.String("EXAMPLE-value-Value"),
Ref: common.String("EXAMPLE-$ref-Value"),
Display: common.String("EXAMPLE-display-Value")},
JitUserProvAssignedGroups: []identitydomains.IdentityProviderJitUserProvAssignedGroups{identitydomains.IdentityProviderJitUserProvAssignedGroups{Value: common.String("EXAMPLE-value-Value"),
Ref: common.String("EXAMPLE-$ref-Value"),
Display: common.String("EXAMPLE-display-Value")}},
JitUserProvGroupAssignmentMethod: identitydomains.IdentityProviderJitUserProvGroupAssignmentMethodMerge,
JitUserProvIgnoreErrorOnAbsentGroups: common.Bool(false),
Schemas: []string{"EXAMPLE--Value"},
UrnIetfParamsScimSchemasOracleIdcsExtensionX509IdentityProvider: &identitydomains.ExtensionX509IdentityProvider{CrlReloadDuration: common.Int(499),
OcspResponderURL: common.String("EXAMPLE-ocspResponderURL-Value"),
CrlCheckOnOCSPFailureEnabled: common.Bool(true),
CrlLocation: common.String("EXAMPLE-crlLocation-Value"),
EkuValues: []identitydomains.ExtensionX509IdentityProviderEkuValuesEnum{identitydomains.ExtensionX509IdentityProviderEkuValuesServerAuth},
OtherCertMatchAttribute: common.String("EXAMPLE-otherCertMatchAttribute-Value"),
CertMatchAttribute: common.String("EXAMPLE-certMatchAttribute-Value"),
CrlEnabled: common.Bool(false),
OcspServerName: common.String("EXAMPLE-ocspServerName-Value"),
OcspEnabled: common.Bool(false),
OcspRevalidateTime: common.Int(200),
OcspEnableSignedResponse: common.Bool(true),
OcspTrustCertChain: []string{"EXAMPLE--Value"},
SigningCertificateChain: []string{"EXAMPLE--Value"},
UserMatchAttribute: common.String("EXAMPLE-userMatchAttribute-Value"),
EkuValidationEnabled: common.Bool(true),
OcspAllowUnknownResponseStatus: common.Bool(true)},
Enabled: common.Bool(false),
JitUserProvCreateUserEnabled: common.Bool(false),
TenantProviderId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-tenantProviderId-Value"),
LogoutEnabled: common.Bool(false),
Meta: &identitydomains.Meta{Created: common.String("EXAMPLE-created-Value"),
LastModified: common.String("EXAMPLE-lastModified-Value"),
Location: common.String("EXAMPLE-location-Value"),
ResourceType: common.String("EXAMPLE-resourceType-Value"),
Version: common.String("EXAMPLE-version-Value")},
UserMappingMethod: identitydomains.IdentityProviderUserMappingMethodCorrelationpolicyrule,
DeleteInProgress: common.Bool(false),
DomainOcid: common.String("EXAMPLE-domainOcid-Value"),
IconUrl: common.String("EXAMPLE-iconUrl-Value"),
IncludeSigningCertInSignature: common.Bool(true),
LogoutBinding: identitydomains.IdentityProviderLogoutBindingRedirect,
IdcsLastModifiedBy: &identitydomains.IdcsLastModifiedBy{Type: identitydomains.IdcsLastModifiedByTypeUser,
Value: common.String("EXAMPLE-value-Value"),
Ref: common.String("EXAMPLE-$ref-Value"),
Display: common.String("EXAMPLE-display-Value"),
Ocid: common.String("EXAMPLE-ocid-Value")},
JitUserProvGroupAssertionAttributeEnabled: common.Bool(true),
RequestedAuthenticationContext: []string{"EXAMPLE--Value"},
UserMappingStoreAttribute: common.String("EXAMPLE-userMappingStoreAttribute-Value"),
ExternalId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value"),
IdcsPreventedOperations: []identitydomains.IdcsPreventedOperationsEnum{identitydomains.IdcsPreventedOperationsDelete},
RequiresEncryptedAssertion: common.Bool(false),
SamlHoKRequired: common.Bool(false),
Tags: []identitydomains.Tags{identitydomains.Tags{Value: common.String("EXAMPLE-value-Value"),
Key: common.String("EXAMPLE-key-Value")}},
Type: identitydomains.IdentityProviderTypeLocal,
JitUserProvAttributes: &identitydomains.IdentityProviderJitUserProvAttributes{Ref: common.String("EXAMPLE-$ref-Value"),
Value: common.String("EXAMPLE-value-Value")}},
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
ResourceTypeSchemaVersion: common.String("EXAMPLE-resourceTypeSchemaVersion-Value")}
// Send the request using the service client
resp, err := client.CreateIdentityProvider(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}