Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [namedcredentials]

The tag has no usage guidance.

19
votes
2answers
2k views

Where to Store Token Auth?

Problem Statement I am working on an integration that will authenticate with a token. I need to pass it via header as follows: "Authorization": "Token abcdefghijklmnopqrstuvwxyz" I also need to ...
10
votes
1answer
539 views

Possible to update NamedCredential from Apex?

Question Is it possible to create or update a NamedCredential from within Apex? Investigation I looked into available options, and it seems the SOAP API only supports the describeSObjects(), query()...
4
votes
2answers
259 views

Set OAuthToken Without Apex Metadata Wrapper?

In working through an answer to this question, I found that I can set the oauthToken value on a NamedCredential using an Apex wrapper for the Metadata API. However, as far as I am aware, that still ...
4
votes
1answer
947 views

Can I use Named Credential merge fields as URL parameters on the endpoint?

I have a named credential as follows: Name Test_Credential URL https://www.somesite.com Identity Type Named Principal Authentication Protocol Password Authentication Username foobar ...
11
votes
1answer
2k views

Using Named Credentials and Auth Provider to manage security token for APEX Callout to an OAuth 2.0 REST API

I'm trying to do an APEX Callout to a OAuth 2.0 secured REST API This is the API https://developers.pandadoc.com/v1/reference#authentication-process I want to use something to manage the security ...
5
votes
1answer
818 views

Named Credentials and support for the OAuth2 Client Credentials Grant Type and alternatives

I have a requirement to authenticate to an external API for callouts using the OAuth2 Client Credentials Grant (This was helpful in referencing the different grant types for me). I would like to use ...
6
votes
1answer
711 views

Session Id not getting refreshed automatically with Custom Auth provider in Salesforce Named Credentials

Problem statement : The Named Credential created for OAuth 2.0 authentication and Custom Auth provider works until the first session Id which was obtained using the method 'handleCallback' is valid. ...
5
votes
1answer
2k views

Mock Testing with Named Credentials

I've successfully implemented Named Credentials for a Basic Auth integration callout. However, when I went to write my test method, I noticed one minor annoyance. When I try to create a ...
4
votes
0answers
274 views

Using Named Credentials in Batch Job (multi user)

Named credentials are working good in single user scenario, where we are making callouts on behalf of a given user. In a recent requirement, we need to setup a "PER USER" Named Credential, which ...
2
votes
1answer
2k views

Migrating Named Credential with password

I retrieved a Named credential using Ant migration tool and in the xml it looks like this: <?xml version="1.0" encoding="UTF-8"?> <NamedCredential xmlns="http://soap.sforce.com/2006/04/...
2
votes
1answer
469 views

Is it possible to set per user Named Credentials via Apex?

I need to integrate with an external system that cannot fully support OAuth 2.0 server flow, so we're looking at just doing a basic username/password flow. So, I think I need to set up Named ...
1
vote
1answer
821 views

Accessing Apex rest class with OAuth 2.0 with Named Credential authentication mechanism

I have been trying to implement Oauth 2.0 in my org and my requirement is to use Named credentials only when making a apex callout. I am using Named credentials, Oauth, Connected Apps and auth. ...
1
vote
0answers
186 views

Where I can store access and secret keys for callouts to AWS SQS service? Should I use Named Credentials or other means suit better for this case

This question has an answer to how to send request to Amazon SQS service from Apex. However, I am concerned that we have to expose access and secret keys in the code. Is this possible to use Named ...
5
votes
1answer
2k views

Using Named Credentials to get Salesforce sessionId

I have a system that is posting data to a streaming channel which works upon data changing and a trigger firing. The a code snippet is shown below. string sessionId = UserInfo.getSessionId()...
2
votes
1answer
89 views

Connect to Salesforce production REST API from Sandbox using Named Credentials

Background I would like to connect to the REST API of a production org, from a sandbox org. Configuration so far: Production Org has a Connected App Sandbox Org has a Auth. Provider Sandbox Org has ...
2
votes
1answer
27 views

Managed package upgrade fails as Named Credential seems to have modified

But the Named Credential hasn't changed between current and new version. So this Known Issue doesn't apply: https://success.salesforce.com/issues_view?id=a1p3A000000mCFtQAM&title=cannot-modify-...
2
votes
1answer
405 views

Named Credential - Automatic refresh token does not work with WSO2 Identity server

I am facing an issue with the named credential platform functionality in the following integration scenario: The Salesforce Org is supposed to perform Rest callouts to a 3rd party service. ...
2
votes
0answers
389 views

How do you use Named Credentials with a Google Cloud API, which requires a JWT to get a token?

Is it possible to used named credentials with a service account to connect to the Google Cloud Platform? I'm trying to make a client to send Pub/Sub messages to Google Cloud from Apex, and it'd be ...