// 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{OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
ResourceTypeSchemaVersion: common.String("EXAMPLE-resourceTypeSchemaVersion-Value"),
AttributeSets: []identitydomains.AttributeSetsEnum{identitydomains.AttributeSetsRequest},
Attributes: common.String("EXAMPLE-attributes-Value"),
Authorization: common.String("EXAMPLE-authorization-Value"),
IdentityProvider: identitydomains.IdentityProvider{JitUserProvGroupStaticListEnabled: common.Bool(true),
Schemas: []string{"EXAMPLE--Value"},
ExternalId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value"),
IdpSsoUrl: common.String("EXAMPLE-idpSsoUrl-Value"),
Ocid: common.String("EXAMPLE-ocid-Value"),
JitUserProvGroupAssertionAttributeEnabled: common.Bool(false),
JitUserProvIgnoreErrorOnAbsentGroups: common.Bool(true),
LogoutRequestUrl: common.String("EXAMPLE-logoutRequestUrl-Value"),
SignatureHashAlgorithm: identitydomains.IdentityProviderSignatureHashAlgorithm256,
DomainOcid: common.String("EXAMPLE-domainOcid-Value"),
EncryptionCertificate: common.String("EXAMPLE-encryptionCertificate-Value"),
IdcsLastModifiedBy: &identitydomains.IdcsLastModifiedBy{Ref: common.String("EXAMPLE-$ref-Value"),
Display: common.String("EXAMPLE-display-Value"),
Ocid: common.String("EXAMPLE-ocid-Value"),
Type: identitydomains.IdcsLastModifiedByTypeUser,
Value: common.String("EXAMPLE-value-Value")},
JitUserProvEnabled: common.Bool(true),
SuccinctId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-succinctId-Value"),
DeleteInProgress: common.Bool(false),
JitUserProvGroupAssignmentMethod: identitydomains.IdentityProviderJitUserProvGroupAssignmentMethodOverwrite,
LogoutEnabled: common.Bool(false),
SamlHoKRequired: common.Bool(false),
Tags: []identitydomains.Tags{identitydomains.Tags{Key: common.String("EXAMPLE-key-Value"),
Value: common.String("EXAMPLE-value-Value")}},
UrnIetfParamsScimSchemasOracleIdcsExtensionSocialIdentityProvider: &identitydomains.ExtensionSocialIdentityProvider{AuthzUrl: common.String("EXAMPLE-authzUrl-Value"),
JitProvGroupStaticListEnabled: common.Bool(true),
RedirectUrl: common.String("EXAMPLE-redirectUrl-Value"),
AccountLinkingEnabled: common.Bool(true),
ConsumerSecret: common.String("EXAMPLE-consumerSecret-Value"),
DiscoveryUrl: common.String("EXAMPLE-discoveryUrl-Value"),
ProfileUrl: common.String("EXAMPLE-profileUrl-Value"),
SocialJitProvisioningEnabled: common.Bool(true),
AdminScope: []string{"EXAMPLE--Value"},
ClientCredentialInPayload: common.Bool(true),
ClockSkewInSeconds: common.Int(671),
ConsumerKey: common.String("EXAMPLE-consumerKey-Value"),
IdAttribute: common.String("EXAMPLE-idAttribute-Value"),
JitProvAssignedGroups: []identitydomains.IdentityProviderJitProvAssignedGroups{identitydomains.IdentityProviderJitProvAssignedGroups{Ref: common.String("EXAMPLE-$ref-Value"),
Display: common.String("EXAMPLE-display-Value"),
Value: common.String("EXAMPLE-value-Value")}},
RegistrationEnabled: common.Bool(true),
Scope: []string{"EXAMPLE--Value"},
AccessTokenUrl: common.String("EXAMPLE-accessTokenUrl-Value"),
ServiceProviderName: common.String("EXAMPLE-serviceProviderName-Value"),
RelayIdpParamMappings: []identitydomains.IdentityProviderRelayIdpParamMappings{identitydomains.IdentityProviderRelayIdpParamMappings{RelayParamKey: common.String("EXAMPLE-relayParamKey-Value"),
RelayParamValue: common.String("EXAMPLE-relayParamValue-Value")}},
Status: identitydomains.ExtensionSocialIdentityProviderStatusCreated,
AutoRedirectEnabled: common.Bool(false)},
IconUrl: common.String("EXAMPLE-iconUrl-Value"),
IncludeSigningCertInSignature: common.Bool(true),
JitUserProvAttributes: &identitydomains.IdentityProviderJitUserProvAttributes{Ref: common.String("EXAMPLE-$ref-Value"),
Value: common.String("EXAMPLE-value-Value")},
JitUserProvGroupSAMLAttributeName: common.String("EXAMPLE-jitUserProvGroupSAMLAttributeName-Value"),
PartnerProviderId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-partnerProviderId-Value"),
RequireForceAuthn: common.Bool(true),
CompartmentOcid: common.String("EXAMPLE-compartmentOcid-Value"),
Id: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value"),
RequestedAuthenticationContext: []string{"EXAMPLE--Value"},
ServiceInstanceIdentifier: common.String("EXAMPLE-serviceInstanceIdentifier-Value"),
IdcsCreatedBy: &identitydomains.IdcsCreatedBy{Value: common.String("EXAMPLE-value-Value"),
Ref: common.String("EXAMPLE-$ref-Value"),
Display: common.String("EXAMPLE-display-Value"),
Ocid: common.String("EXAMPLE-ocid-Value"),
Type: identitydomains.IdcsCreatedByTypeApp},
LastNotificationSentTime: common.String("EXAMPLE-lastNotificationSentTime-Value"),
TenancyOcid: common.String("EXAMPLE-tenancyOcid-Value"),
JitUserProvAssignedGroups: []identitydomains.IdentityProviderJitUserProvAssignedGroups{identitydomains.IdentityProviderJitUserProvAssignedGroups{Ref: common.String("EXAMPLE-$ref-Value"),
Display: common.String("EXAMPLE-display-Value"),
Value: common.String("EXAMPLE-value-Value")}},
JitUserProvGroupMappings: []identitydomains.IdentityProviderJitUserProvGroupMappings{identitydomains.IdentityProviderJitUserProvGroupMappings{Ref: common.String("EXAMPLE-$ref-Value"),
IdpGroup: common.String("EXAMPLE-idpGroup-Value"),
Value: common.String("EXAMPLE-value-Value")}},
NameIdFormat: common.String("EXAMPLE-nameIdFormat-Value"),
ShownOnLoginPage: common.Bool(false),
SigningCertificate: common.String("EXAMPLE-signingCertificate-Value"),
TenantProviderId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-tenantProviderId-Value"),
UserMappingMethod: identitydomains.IdentityProviderUserMappingMethodNameidtouserattribute,
JitUserProvCreateUserEnabled: common.Bool(false),
LogoutBinding: identitydomains.IdentityProviderLogoutBindingRedirect,
Metadata: common.String("EXAMPLE-metadata-Value"),
PartnerName: common.String("EXAMPLE-partnerName-Value"),
RequiresEncryptedAssertion: common.Bool(false),
Type: identitydomains.IdentityProviderTypeSaml,
JitUserProvGroupMappingMode: identitydomains.IdentityProviderJitUserProvGroupMappingModeExplicit,
AssertionAttribute: common.String("EXAMPLE-assertionAttribute-Value"),
CorrelationPolicy: &identitydomains.IdentityProviderCorrelationPolicy{Value: common.String("EXAMPLE-value-Value"),
Ref: common.String("EXAMPLE-$ref-Value"),
Display: common.String("EXAMPLE-display-Value"),
Type: identitydomains.IdentityProviderCorrelationPolicyTypePolicy},
IdcsPreventedOperations: []identitydomains.IdcsPreventedOperationsEnum{identitydomains.IdcsPreventedOperationsReplace},
JitUserProvAttributeUpdateEnabled: common.Bool(false),
UserMappingStoreAttribute: common.String("EXAMPLE-userMappingStoreAttribute-Value"),
Description: common.String("EXAMPLE-description-Value"),
IdcsLastUpgradedInRelease: common.String("EXAMPLE-idcsLastUpgradedInRelease-Value"),
Meta: &identitydomains.Meta{Location: common.String("EXAMPLE-location-Value"),
ResourceType: common.String("EXAMPLE-resourceType-Value"),
Version: common.String("EXAMPLE-version-Value"),
Created: common.String("EXAMPLE-created-Value"),
LastModified: common.String("EXAMPLE-lastModified-Value")},
AuthnRequestBinding: identitydomains.IdentityProviderAuthnRequestBindingPost,
Enabled: common.Bool(false),
LogoutResponseUrl: common.String("EXAMPLE-logoutResponseUrl-Value"),
UrnIetfParamsScimSchemasOracleIdcsExtensionX509IdentityProvider: &identitydomains.ExtensionX509IdentityProvider{CrlReloadDuration: common.Int(542),
OcspEnableSignedResponse: common.Bool(false),
UserMatchAttribute: common.String("EXAMPLE-userMatchAttribute-Value"),
CrlLocation: common.String("EXAMPLE-crlLocation-Value"),
EkuValues: []identitydomains.ExtensionX509IdentityProviderEkuValuesEnum{identitydomains.ExtensionX509IdentityProviderEkuValuesTimeStamping},
OcspAllowUnknownResponseStatus: common.Bool(true),
OcspResponderURL: common.String("EXAMPLE-ocspResponderURL-Value"),
OtherCertMatchAttribute: common.String("EXAMPLE-otherCertMatchAttribute-Value"),
OcspTrustCertChain: []string{"EXAMPLE--Value"},
CertMatchAttribute: common.String("EXAMPLE-certMatchAttribute-Value"),
CrlCheckOnOCSPFailureEnabled: common.Bool(false),
EkuValidationEnabled: common.Bool(true),
OcspRevalidateTime: common.Int(250),
OcspServerName: common.String("EXAMPLE-ocspServerName-Value"),
CrlEnabled: common.Bool(false),
OcspEnabled: common.Bool(true),
SigningCertificateChain: []string{"EXAMPLE--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)
}