// 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).
import * as identitydomains from "oci-identitydomains";
import common = require("oci-common");
// 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.
const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();
(async () => {
try {
// Create a service client
const client = new identitydomains.IdentityDomainsClient({ authenticationDetailsProvider: provider });
// Create a request and dependent object(s).
const app = {
id: "ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
ocid: "EXAMPLE-ocid-Value",
schemas: ["EXAMPLE--Value" ],
meta: {
resourceType: "EXAMPLE-resourceType-Value",
created: "EXAMPLE-created-Value",
lastModified: "EXAMPLE-lastModified-Value",
location: "EXAMPLE-location-Value",
version: "EXAMPLE-version-Value",
}
,
idcsCreatedBy: {
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
type: identitydomains.models.IdcsCreatedBy.Type.User,
display: "EXAMPLE-display-Value",
ocid: "EXAMPLE-ocid-Value",
}
,
idcsLastModifiedBy: {
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
type: identitydomains.models.IdcsLastModifiedBy.Type.User,
display: "EXAMPLE-display-Value",
ocid: "EXAMPLE-ocid-Value",
}
,
idcsPreventedOperations: [identitydomains.models.IdcsPreventedOperations.Replace ],
tags: [{
key: "EXAMPLE-key-Value",
value: "EXAMPLE-value-Value",
}
],
deleteInProgress: true,
idcsLastUpgradedInRelease: "EXAMPLE-idcsLastUpgradedInRelease-Value",
domainOcid: "EXAMPLE-domainOcid-Value",
compartmentOcid: "EXAMPLE-compartmentOcid-Value",
tenancyOcid: "EXAMPLE-tenancyOcid-Value",
meterAsOPCService: false,
name: "EXAMPLE-name-Value",
clientSecret: "EXAMPLE-clientSecret-Value",
hashedClientSecret: "EXAMPLE-hashedClientSecret-Value",
displayName: "EXAMPLE-displayName-Value",
description: "EXAMPLE-description-Value",
idTokenEncAlgo: "EXAMPLE-idTokenEncAlgo-Value",
delegatedServiceNames: ["EXAMPLE--Value" ],
active: false,
appIcon: "EXAMPLE-appIcon-Value",
appThumbnail: "EXAMPLE-appThumbnail-Value",
migrated: false,
infrastructure: false,
isLoginTarget: false,
showInMyApps: true,
loginMechanism: identitydomains.models.App.LoginMechanism.Oidc,
landingPageUrl: "EXAMPLE-landingPageUrl-Value",
productLogoUrl: "EXAMPLE-productLogoUrl-Value",
privacyPolicyUrl: "EXAMPLE-privacyPolicyUrl-Value",
termsOfServiceUrl: "EXAMPLE-termsOfServiceUrl-Value",
contactEmailAddress: "EXAMPLE-contactEmailAddress-Value",
productName: "EXAMPLE-productName-Value",
homePageUrl: "EXAMPLE-homePageUrl-Value",
isFormFill: false,
isOAuthClient: false,
isRadiusApp: true,
clientType: identitydomains.models.App.ClientType.Confidential,
redirectUris: ["EXAMPLE--Value" ],
allUrlSchemesAllowed: false,
logoutUri: "EXAMPLE-logoutUri-Value",
postLogoutRedirectUris: ["EXAMPLE--Value" ],
allowedGrants: ["EXAMPLE--Value" ],
allowedOperations: [identitydomains.models.App.AllowedOperations.OnBehalfOfUser ],
clientIPChecking: identitydomains.models.App.ClientIPChecking.Whitelisted,
isOPCService: true,
isUnmanagedApp: true,
allowAccessControl: true,
isOAuthResource: false,
accessTokenExpiry: 530,
refreshTokenExpiry: 174,
allowOffline: false,
callbackServiceUrl: "EXAMPLE-callbackServiceUrl-Value",
audience: "EXAMPLE-audience-Value",
isMobileTarget: false,
loginPageUrl: "EXAMPLE-loginPageUrl-Value",
linkingCallbackUrl: "EXAMPLE-linkingCallbackUrl-Value",
logoutPageUrl: "EXAMPLE-logoutPageUrl-Value",
errorPageUrl: "EXAMPLE-errorPageUrl-Value",
isSamlServiceProvider: true,
isWebTierPolicy: true,
isKerberosRealm: false,
icon: "EXAMPLE-icon-Value",
isAliasApp: true,
isManagedApp: false,
serviceTypeURN: "EXAMPLE-serviceTypeURN-Value",
serviceTypeVersion: "EXAMPLE-serviceTypeVersion-Value",
isObligationCapable: false,
readyToUpgrade: false,
trustScope: identitydomains.models.App.TrustScope.Default,
isDatabaseService: true,
secondaryAudiences: ["EXAMPLE--Value" ],
isEnterpriseApp: false,
bypassConsent: false,
disableKmsiTokenAuthentication: true,
isMulticloudServiceApp: false,
radiusPolicy: {
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
}
,
appsNetworkPerimeters: [{
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
}
],
cloudControlProperties: [{
name: "EXAMPLE-name-Value",
values: ["EXAMPLE--Value" ],
}
],
editableAttributes: [{
name: "EXAMPLE-name-Value",
}
],
termsOfUse: {
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
name: "EXAMPLE-name-Value",
}
,
protectableSecondaryAudiences: [{
value: "EXAMPLE-value-Value",
readOnly: false,
}
],
idpPolicy: {
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
}
,
allowedTags: [{
key: "EXAMPLE-key-Value",
value: "EXAMPLE-value-Value",
readOnly: true,
}
],
appSignonPolicy: {
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
}
,
trustPolicies: [{
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
}
],
signonPolicy: {
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
}
,
identityProviders: [{
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
display: "EXAMPLE-display-Value",
}
],
accounts: [{
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
ownerId: "ocid1.test.oc1..<unique_ID>EXAMPLE-ownerId-Value",
name: "EXAMPLE-name-Value",
active: false,
}
],
grants: [{
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
granteeId: "ocid1.test.oc1..<unique_ID>EXAMPLE-granteeId-Value",
granteeType: identitydomains.models.AppGrants.GranteeType.Group,
grantMechanism: identitydomains.models.AppGrants.GrantMechanism.OpcInfraToApp,
}
],
serviceParams: [{
name: "EXAMPLE-name-Value",
value: "EXAMPLE-value-Value",
}
],
attrRenderingMetadata: [{
name: "EXAMPLE-name-Value",
label: "EXAMPLE-label-Value",
helptext: "EXAMPLE-helptext-Value",
widget: identitydomains.models.AppAttrRenderingMetadata.Widget.Checkbox,
datatype: "EXAMPLE-datatype-Value",
section: identitydomains.models.AppAttrRenderingMetadata.Section.General,
order: 761,
required: true,
regexp: "EXAMPLE-regexp-Value",
readOnly: false,
visible: false,
minLength: 238,
maxLength: 585,
minSize: 381,
maxSize: 375,
}
],
basedOnTemplate: {
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
lastModified: "EXAMPLE-lastModified-Value",
wellKnownId: "ocid1.test.oc1..<unique_ID>EXAMPLE-wellKnownId-Value",
}
,
grantedAppRoles: [{
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
type: identitydomains.models.AppGrantedAppRoles.Type.Indirect,
display: "EXAMPLE-display-Value",
appId: "ocid1.test.oc1..<unique_ID>EXAMPLE-appId-Value",
appName: "EXAMPLE-appName-Value",
adminRole: true,
legacyGroupName: "EXAMPLE-legacyGroupName-Value",
readOnly: true,
}
],
samlServiceProvider: {
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
}
,
allowedScopes: [{
fqs: "EXAMPLE-fqs-Value",
idOfDefiningApp: "EXAMPLE-idOfDefiningApp-Value",
readOnly: false,
}
],
certificates: [{
certAlias: "EXAMPLE-certAlias-Value",
sha1Thumbprint: "EXAMPLE-sha1Thumbprint-Value",
kid: "EXAMPLE-kid-Value",
x5t: "EXAMPLE-x5t-Value",
x509Base64Certificate: "EXAMPLE-x509Base64Certificate-Value",
}
],
aliasApps: [{
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
display: "EXAMPLE-display-Value",
description: "EXAMPLE-description-Value",
}
],
asOPCService: {
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
}
,
adminRoles: [{
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
display: "EXAMPLE-display-Value",
description: "EXAMPLE-description-Value",
}
],
userRoles: [{
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
display: "EXAMPLE-display-Value",
description: "EXAMPLE-description-Value",
}
],
scopes: [{
value: "EXAMPLE-value-Value",
fqs: "EXAMPLE-fqs-Value",
description: "EXAMPLE-description-Value",
displayName: "EXAMPLE-displayName-Value",
requiresConsent: false,
readOnly: false,
}
],
}
const createAppRequest: identitydomains.requests.CreateAppRequest = {
authorization: "EXAMPLE-authorization-Value",
resourceTypeSchemaVersion: "EXAMPLE-resourceTypeSchemaVersion-Value",
attributes: "EXAMPLE-attributes-Value",
attributeSets: [identitydomains.models.AttributeSets.Never ],
app: app,
opcRetryToken: "EXAMPLE-opcRetryToken-Value",
};
// Send request to the Client.
const createAppResponse = await client.createApp(createAppRequest);
}
catch (error) {
console.log("createApp Failed with error " + error);
}
})();