I need to intergrate our custom Developer Portal with Auth0 and so at app creation. So I need the Client ID and Client Secret from Auth0 integrated with the APP credentials of Apigee.
Using the JS policy I always end up in exchange.isError() Even though the key is created
var url = 'https://api.enterprise.apigee.com/v1/organizations/' + organization + '/developers/' + developerEmail + '/apps/' + productName + '/keys/create'; var headers = { 'Content-Type' : 'application/json', 'Authorization' : base64Credentials }; var payload = '{ "consumerKey": "' + key + '", "consumerSecret": "' + secret + '" }'; var request = new Request(url, 'POST', headers, payload); var exchange = httpClient.send(request); exchange.waitForComplete(); if (exchange.isSuccess()) { var response = exchange.getResponse(); context.setVariable('response.content', response.content); } else if(exchange.isError()){ context.setVariable('response.content', 'Error'); }
I want to have more control then the callout policy offers but it seems that the exchange object doesn't contain error information when isError() is true.
documentation on management API: App keys: Developer | Edge APIs (apigee.com)