Skip to content

Latest commit

 

History

History
83 lines (77 loc) · 2.71 KB

File metadata and controls

83 lines (77 loc) · 2.71 KB
description Automatically generated file. DO NOT MODIFY
const options = {
	authProvider,
};

const client = Client.init(options);

const tenantAppManagementPolicy = {
    isEnabled: true,
    applicationRestrictions: {
        passwordCredentials: [
            {
                restrictionType: 'passwordAddition',
                maxLifetime: null,
                restrictForAppsCreatedAfterDateTime: '2021-01-01T10:37:00Z'
            },
            {
                restrictionType: 'passwordLifetime',
                maxLifetime: 'P90D',
                restrictForAppsCreatedAfterDateTime: '2017-01-01T10:37:00Z'
            },
            {
                restrictionType: 'symmetricKeyAddition',
                maxLifetime: null,
                restrictForAppsCreatedAfterDateTime: '2021-01-01T10:37:00Z'
            },
            {
                restrictionType: 'customPasswordAddition',
                maxLifetime: null,
                restrictForAppsCreatedAfterDateTime: '2015-01-01T10:37:00Z'
            },
            {
                restrictionType: 'symmetricKeyLifetime',
                maxLifetime: 'P30D',
                restrictForAppsCreatedAfterDateTime: '2015-01-01T10:37:00Z'
            }
        ],
        keyCredentials: [
            {
                restrictionType: 'asymmetricKeyLifetime',
                maxLifetime: 'P30D',
                restrictForAppsCreatedAfterDateTime: '2015-01-01T10:37:00Z'
            },
            {
                restrictionType: 'trustedCertificateAuthority',
                restrictForAppsCreatedAfterDateTime: '2019-10-19T10:37:00Z',
                certificateBasedApplicationConfigurationIds: [
                    'eec5ba11-2fc0-4113-83a2-ed986ed13743',
                    'bb8e164b-f9ed-4b98-bc45-65eddc14f4c1'
                ],
                maxLifetime: null
            }
        ],
        identifierUris: {
            nonDefaultUriAddition: {
                restrictForAppsCreatedAfterDateTime: '2024-01-01T10:37:00Z',
                excludeAppsReceivingV2Tokens: true,
                excludeSaml: true,
                excludeActors: {
                    customSecurityAttributes: [
                        {
                            '@odata.type': 'microsoft.graph.customSecurityAttributeStringValueExemption',
                            id: 'PolicyExemptions_AppManagementExemption',
                            operator: 'equals',
                            value: 'ExemptFromIdentifierUriAdditionRestriction'
                        }
                    ]
                }
            }
        }
    }
};

await client.api('/policies/defaultAppManagementPolicy')
	.version('beta')
	.update(tenantAppManagementPolicy);