I'm trying to make REST callouts from Salesforce to Sharepoint and I'm getting an "Invalid issuer or signature" response from my code. I tried generating a self-signed certificate on Salesforce and uploading the .crt file in my Sharepoint app, but the same error message still persists. Is there something I'm missing here?
Something else I don't understand is that when I upload the Salesforce certificate using the "Upload Public Key", I get a Private Key type generated for that public cert with a private key number. Maybe this a mislabeling on the App Registration Portal itself?
Salesforce Apex REST code:
public class AuthCallout {
public static void basicAuthCallout(){
HttpRequest req = new HttpRequest();
req.setMethod('GET');
req.setEndpoint('callout:Sharepoint_Online/_api/web/list');
}
}
The Sharepoint_Online Named Credential uses the self-signed certificate and Oauth2.0 with the "Files.Read.All Sites.Read.All offline_access" scope. The authentication status says Authenticated, so I know that part is fine. From SF, I downloaded the public .crt file and reuploaded it to my registered app in "apps.dev.microsoft.com".