I am actually using named credentials to do a callout to another salesforce instance. The following code works well in my sandbox :
HttpRequest req = new HttpRequest();
req.setEndpoint('callout:Oneye_connection/services/data/v52.0/query/?q=SELECT+name+from+account+limit+1');
req.setMethod('GET');
req.setHeader('Content-Type','application/json');
Http http = new Http();
HTTPResponse resp = http.send(req);
system.debug('## resp :' + resp);
but when deploying to production org and setting up manually the auth. provider and named credentials, I'm getting a 404 error.
My authentication provider and named credentials has been well configured. See screenshot below :
However when executing the code I am obtaining the following : System.HttpResponse[Status=Not Found, StatusCode=404]. As if salesforce has not been able to evaluate the named credential. Do I need other settings a part from auth. provider and named credential?