I've got a new named credential setup using an OIDC auth provider and the named principal type. It's authenticated successfully but when I try to call it I get
String namedCredential = 'callout:asdf';
HttpRequest req = new HttpRequest();
req.setMethod('GET');
req.setEndpoint(namedCredential + '/asdf/blah');
HttpResponse res = new Http().send(req);
System.debug(res);
System.debug(res.getBody());
I get the following error
18:15:34.272 (278743815)|EXCEPTION_THROWN|[5]|System.CalloutException: The callout
couldn't access the endpoint. You might not have the required permissions, or the
named credential "XXX" might not exist.
I'm using a system admin profile so was a bit surprised at first to get any errors. But no worries, I'll go add it. But when I try to add it to the profile there are no available named credentials to add to the profile.
So maybe it's just system admins not being custom profiles there are restrictions so i go to permission sets, but same thing. There are zero named credentials available to grant access to even though there are four in the org.