private static async createAadApp()

in src/configure/helper/graphHelper.ts [96:125]


    private static async createAadApp(graphClient: RestClient, name: string, tenantId: string): Promise<AadApplication> {
        let secret = generateRandomPassword(20);
        let startDate = new Date(Date.now());

        return graphClient.sendRequest<any>({
            url: `https://graph.windows.net/${tenantId}/applications`,
            queryParameters: {
                "api-version": "1.6"
            },
            method: "POST",
            body: {
                "availableToOtherTenants": false,
                "displayName": name,
                "homepage": "https://" + name,
                "passwordCredentials": [
                    {
                        "startDate": startDate,
                        "endDate": new Date(startDate.getFullYear() + 1, startDate.getMonth()),
                        "value": secret
                    }
                ]
            }
        })
        .then((data) => {
            return <AadApplication>{
                appId: data.appId,
                secret: secret
            };
        });
    }