define("CALLBACK_URL", "http://localhost/logify/token.php"); define("AUTH_URL", "https://login.microsoftonline.com/a188257a-982f-445c-8894-0240d0163135/oauth2/v2.0/authorize"); define("ACCESS_TOKEN_URL", "https://login.microsoftonline.com/a188257a-982f-445c-8894-0240d0163135/oauth2/v2.0/token"); define("CLIENT_ID", "4c42d3a0-51e7-4470-b614-670c7865501b"); define("CLIENT_SECRET", "9Yu8Q~Fubid~uV2Uq8PWFxuw8WZSfFw3siFH~ccB"); define("SCOPE", "https://graph.microsoft.com/.default"); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://login.microsoftonline.com/a188257a-982f-445c-8894-0240d0163135/oauth2/v2.0/token', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{ "code" : "0.AXwAeiWIoS-YXESIlAJA0BYxNaDTQkznUXBEthRnDHhlUBu7ADA.AgABAAIAAAD--DLA3VO7QrddgJg7WevrAgDs_wQA9P9mdW4XBuDJBsZysaOpqcRD5Z7o0e_Ym_6v4ECYpHTs72h152J8GjZSlvg2vEO_86xGt2Imvbn6Rxqx5bUCSa3sMYJj0XYE4E0cTGw9CICVg5IG1s3bHlMXLfOVRbIgcMOqvK9ab42FFVr5C1peWHD8nH91K64X4Vdxa5HX4QBmCFxYM4id4ke3rcTZHdGefX39fGvEvJ4cCUZ-eerg1okJ80ZsGLW4pYQizX4bMrvht_eyGPqCmgA3aqSl6wxW14sPG45J2cQgGTBpbs3jHaLDEx4by_TXxIEUnQZbDNrGuso_-ibaLfjgCkkARHY6JrxXCWpcJxymO7Qyr5vuPqVr6dgQTd9uomGgZMc_EB-NI4disHdCnSgGVH2YnPH8sk0vGxxrcLYlMKd29TJESAlPKnuoES2MQ6iz_1Q3R5gwc1DdCTM6cwA5bwEzOSQy63FtAxApnWc-D1Nh9gbU-44KceVz3w3RY4qs4Ga_a5eBHhYlSH0E0z15cHdPvxFuiM414SUuBVjjZD0uEOQZs5nqfBcM1GVCTH08T8D83T1AKFTdrbw5XvHhTFh-lipizZu8FaYs5X90gg_4KTiB9sdYz7-VMBZuA0ygVH6R8APvVcIMHrpfRuOrXU3UgV2g5Sg6tg__YK1hHliL0DZpGVtbc94jEUcxo9jFUbF5lw", "grant_type" : "authorization_code", "redirect_uri" : "http://localhost/logify/token.php", "state" : "mail.Send", "name" : "EmailSending", "client_id" : "4c42d3a0-51e7-4470-b614-670c7865501b", "client_secret" : "9Yu8Q~Fubid~uV2Uq8PWFxuw8WZSfFw3siFH~ccB", "scope" : "https://graph.microsoft.com/.default" }', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI6IjVoZno4OVdpYjdIMzVhNmd4cUVCdDZuU3V3V3o0bHYzYXEzc3ZKa1JEcGMiLCJhbGciOiJSUzI1NiIsIng1dCI6Ii1LSTNROW5OUjdiUm9meG1lWm9YcWJIWkdldyIsImtpZCI6Ii1LSTNROW5OUjdiUm9meG1lWm9YcWJIWkdldyJ9.eyJhdWQiOiJodHRwczovL2dyYXBoLm1pY3Jvc29mdC5jb20iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC9hMTg4MjU3YS05ODJmLTQ0NWMtODg5NC0wMjQwZDAxNjMxMzUvIiwiaWF0IjoxNjcxMjkxNDU0LCJuYmYiOjE2NzEyOTE0NTQsImV4cCI6MTY3MTI5NTM1NCwiYWlvIjoiRTJaZ1lIQXZVZU9mdk90RCsxN2hwSlU3cDY1YkFnQT0iLCJhcHBfZGlzcGxheW5hbWUiOiJFbWFpbFNlbmRpbmciLCJhcHBpZCI6IjRjNDJkM2EwLTUxZTctNDQ3MC1iNjE0LTY3MGM3ODY1NTAxYiIsImFwcGlkYWNyIjoiM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