// 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.App,
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: true,
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: true,
appIcon: "EXAMPLE-appIcon-Value",
appThumbnail: "EXAMPLE-appThumbnail-Value",
migrated: false,
infrastructure: false,
isLoginTarget: true,
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.Trusted,
redirectUris: ["EXAMPLE--Value"],
allUrlSchemesAllowed: false,
logoutUri: "EXAMPLE-logoutUri-Value",
postLogoutRedirectUris: ["EXAMPLE--Value"],
allowedGrants: ["EXAMPLE--Value"],
allowedOperations: [identitydomains.models.App.AllowedOperations.Introspect],
clientIPChecking: identitydomains.models.App.ClientIPChecking.Anywhere,
isOPCService: false,
isUnmanagedApp: true,
allowAccessControl: true,
isOAuthResource: true,
accessTokenExpiry: 768,
refreshTokenExpiry: 305,
allowOffline: true,
callbackServiceUrl: "EXAMPLE-callbackServiceUrl-Value",
audience: "EXAMPLE-audience-Value",
isMobileTarget: true,
loginPageUrl: "EXAMPLE-loginPageUrl-Value",
linkingCallbackUrl: "EXAMPLE-linkingCallbackUrl-Value",
logoutPageUrl: "EXAMPLE-logoutPageUrl-Value",
errorPageUrl: "EXAMPLE-errorPageUrl-Value",
isSamlServiceProvider: false,
isWebTierPolicy: false,
isKerberosRealm: true,
icon: "EXAMPLE-icon-Value",
isAliasApp: false,
isManagedApp: true,
serviceTypeURN: "EXAMPLE-serviceTypeURN-Value",
serviceTypeVersion: "EXAMPLE-serviceTypeVersion-Value",
isObligationCapable: true,
readyToUpgrade: false,
trustScope: identitydomains.models.App.TrustScope.Default,
isDatabaseService: false,
secondaryAudiences: ["EXAMPLE--Value"],
isEnterpriseApp: false,
bypassConsent: true,
disableKmsiTokenAuthentication: false,
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: true
}
],
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: true
}
],
grants: [
{
value: "EXAMPLE-value-Value",
ref: "EXAMPLE-$ref-Value",
granteeId: "ocid1.test.oc1..<unique_ID>EXAMPLE-granteeId-Value",
granteeType: identitydomains.models.AppGrants.GranteeType.User,
grantMechanism: identitydomains.models.AppGrants.GrantMechanism.ServiceManagerToApp
}
],
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.Inputtext,
datatype: "EXAMPLE-datatype-Value",
section: identitydomains.models.AppAttrRenderingMetadata.Section.General,
order: 76,
required: false,
regexp: "EXAMPLE-regexp-Value",
readOnly: true,
visible: false,
minLength: 663,
maxLength: 23,
minSize: 120,
maxSize: 196
}
],
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.Direct,
display: "EXAMPLE-display-Value",
appId: "ocid1.test.oc1..<unique_ID>EXAMPLE-appId-Value",
appName: "EXAMPLE-appName-Value",
adminRole: false,
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.Always],
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);
}
})();