Configure external credentials that use the OAuth protocol to use JWT Bearer Flow. JWT Bearer Flow provides increased security for system integrations by employing a JSON Web Token (JWT) and certificates to sign requests. Salesforce named credentials support custom claims with JWT Bearer Flow.
Where: This change applies to Lightning Experience and Salesforce Classic in all editions.
How: When creating an external credential from the UI, select JWT Bearer Flow. You can also use the Metadata, Tooling, and Apex ConnectApi APIs to create and edit external credentials.
Use OAuth JWT Bearer Flow with Named Credentials (salesforce.com)