Questions tagged [namedcredentials]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
32 views

Named credentials returning Unauthorized, 401

I have setup a connected App, Auth. provider and Named credential to call an Apexrest in a same Salesforce org but I am continuously getting Unauthorized 401. Surprisingly, it is working in a ...
1
vote
1answer
33 views

Using Named Credentials to send API key in Authorization header

I'm trying to make use of Salesforce Named Credentials to securely store the API Key and call endpoint accordingly. I tried to pass a custom API Key to an endpoint as below. HttpRequest req = new ...
0
votes
0answers
44 views

How to access a Named Credential as a Guest User?

I want a Site Guest User to be able to hit a page that uses Apex to do an API call. However, if I create a Named Credential of type 'Named Principal', then that credential is simply missing from the ...
0
votes
1answer
43 views

How can I write a post install script in apex that creates named credentials?

I would like to understand: If we can write a post install script to create a named credential that is required to be able to view a certain report in the managed package(the report feature that I am ...
0
votes
1answer
57 views

Build pre-signed AWS S3 URLs with Named Credentials [duplicate]

I'm building an integration with S3 and I want to create a pre-signed URL so I can access S3 from SF with a single user. I use the method below to generate a URL: public static string getSignedURL(...
10
votes
1answer
388 views

Custom REST controller to access Auth.AuthToken.getAccessToken returning null

Following on from a previous question: How to access OAuth Token stored in NamedCredential using Apex for use in other third party application I've created a custom REST endpoint which proxies ...
1
vote
1answer
75 views

How to access OAuth Token stored in NamedCredential using Apex for use in other third party application

I'd like to use the native Salesforce Auth. Provider and Named Credential capabilities to allow a Salesforce user to follow the OAuth flow to authenticate against a 3rd party service, and then later ...
0
votes
0answers
25 views

Per User Authentication for External Service

As part of my use case, I need to integrate different external sources from Salesforce . All the authentication has to be per-user and this whole thing needs to be part of managed package. Now the few ...
0
votes
0answers
31 views

Named Credentials and REST Callout for an API that provides me with a token [duplicate]

Writing an Apex class to make REST Callouts to several API endpoints (Jira, Tempo, and Zendesk). Methods on the class will be invoked daily by the Apex Job Scheduler. Jira was easy to setup using ...
0
votes
0answers
29 views

Custom Merge Field Named Credential Apex

I am integrating with GoToWebinar using a Named Credential to make Apex Callouts. While the Authentication piece is working well, during the Callback to get the access token, there are some additional ...
3
votes
1answer
143 views

Why can't we package custom AuthProvider in Managed Package

My Managed Package app connects to an external REST API. This API uses OAuth2. For easy connectivity, I planned on packaging a custom AuthProvider with all the app-specific settings like URLs and ...
0
votes
0answers
22 views

How to write to ExternalDataUserAuth programatically? [duplicate]

Is it possible to write records to the ExternalDataUserAuth object via Apex code? When I try to write some Apex code to insert records into the ExternalDataUserAuth object I get an 'illegal dml object'...
1
vote
0answers
31 views

Does Declarative Amazon Signatue Version 4 Named Credential Work At All With External Services and Flow

Can anyone confirm if they have EVER used declarative AWS Signature Version 4 as a Named Credential with External Services and Flow in Salesforce for ANY reason? Not Apex Classes to set these. A ...
1
vote
2answers
128 views

Per User Named Credential and External Identity Users [duplicate]

My question is almost similar to one mentioned in 'Auth Provider with per-user Named Credential' (Auth Provider with per-user Named Credential). I am trying to authenticate and make a API call when a ...
1
vote
1answer
54 views

Users need to reauthenticate Per User Oauth2 Integration

I have an AppExchange App which uses OAuth2 Per User Authentication to access a 3rd Party REST API. To configure the app the Admin needs to create an AuthProvider, NamedCredential and a per User ...
0
votes
0answers
23 views

How to upsert attachment using Named credential callout to Rest api endpoint?

I am trying insert/update attachment on a record by making use of Named Credential that I have setup on a different org. I am passing the attachment properties (Name, Body, ParentId, Description) from ...
0
votes
2answers
94 views

Authenticated Lightning Out with another Salesforce Org

Immediate Question: Is there a way to use authenticated Lightning Out with another Salesforce Org? We've currently got two Salesforce Orgs: Org A and Org B In Org A, we've created a flow that allows ...
1
vote
1answer
94 views

How does a Named Credential with a custom Auth. Provider check token validity?

When using a custom OAuth 2.0 provider as an extension of AuthProviderPluginClass for a Named Credential how does Salesforce check whether the current token is valid before attempting to request a new ...
6
votes
0answers
93 views

Manually Invoke Refresh on Custom AuthProviderPluginClass

I have recently implemented a custom auth plugin provider in hopes of getting away from making a token call with every request OR having to manage the token myself. I am using the Oauth 2.0 client ...
2
votes
2answers
80 views

Create NamedCredentials for AWS Signature via Metadata API

I am trying to create the named credentials for AWS using Metadata API. I am getting the following error: System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: '...
2
votes
0answers
70 views

Named Credentials with OAuth getting AUTHENTICATION_FAILURE Message on Save [closed]

Getting Following error when i tried to save Named Credential with OAuth 2.0 Authentication Protocol Named Credentials: { "name": "AUTHENTICATION_FAILURE", "message": &...
1
vote
1answer
55 views

Named Credential Not Working with Bitly Integration [closed]

I have used Named Credential to integrate with Bitly. But getting an error as Forbidden in the logs. Below is my code: public class BitlyService { public String shorten( String url ...
1
vote
0answers
39 views

Is our “Identity Server” a Good Use Case for Named Credentials and if so, how should I use Named Credentials Instead?

We have a collection of microservices hosted on Azure. In order to access these, we must first get a token from what's been described as the "identity server". I can use this code to get the ...
0
votes
1answer
56 views

Managed Package Named Credential password gone

I have a managed package with some apex code that makes a callout to a named credential. The named credential uses a username and password. This gets send in a header in the callout request as an ...
0
votes
0answers
70 views

Error while using client certificate in callouts [duplicate]

I am integrating with an external API which expects client certificate in the request. They had provided .p12 file. I have converted it into .jks and imported in Salesforce. I have tried to use it two ...
1
vote
1answer
90 views

Callout to other Salesforce org using Named Credential - which Authentication option should I use?

I have 2 Salesforce orgs (with identical code) - a hub and a client. I need to pass data from the hub to the client. Using S2S is fine for normal data, but when it comes to files (eg pdf) we can't use ...
2
votes
1answer
197 views

Named Credential authentication with GoToWebinar (OAuth2)

I am trying to connect Salesforce with GoToWebinar (GTW) to automate webinar activities within my Salesforce app. I am attempting to use Named Credentials (OAuth2) to authenticate with GTW. I have ...
0
votes
1answer
60 views

Making a callout To Marketing cloud from Service Cloud External Services

I have been trying to invoke Marketing Cloud Transactional API from Salesforce Service cloud. I saw there is a Marketing Cloud Open API Spec for Transactional Messaging: https://sforce.co/2GuuYMn and ...
0
votes
0answers
35 views

Access Named Credentials with merge fields [duplicate]

I am on a task where I need to call an external webservice that takes the username and password in the request body, not as part of Authorization header. I did setup the username and password using ...
1
vote
1answer
57 views

Calling REST APIs from Lightning

We are currently working on an app where we are calling the Tooling API from our Lightning component Since UserInfo.getSessionId() is not valid in Lightning context, to make the call we are using VF ...
0
votes
0answers
119 views

Named Credential Issue (redirect_uri_mismatch)

We have a fairly complex web service intended only for outside use. We got a last-minute request to use the API internally, and its a lot faster to just call the API than open up the service. Yes, I ...
0
votes
0answers
63 views

Managing per-user Named Credential instances for access to 3rd party apps via an Auth Provider

Context Let's say we have an Auth.Provider with Microsoft Access Control Service in place + a Named Credential set with Per User + OAuth 2.0 and the previous Auth. Provider set. Then I set the proper ...
0
votes
0answers
62 views

External Services - Basic Auth via Named Credential

I added the web service as an 'External Service' based on swagger 2.0 and selected the Named Credential. The web service supports basic auth. However, there is no auth header sent as I would expect ...
3
votes
1answer
305 views

Securely Storing Oauth Credentials for Apex Callouts

I am again trying to understand what is the best possible option to securely making the apex callouts from a trigger to external application which supports OAuth2. I am not building any application/...
1
vote
1answer
361 views

Using Named Credential + OpenID Connect auth provider to obtain access token with client_credentials grant

I am trying to use the Named credentials for the first time without using the named credentials directly if I call the endpoints with credentials it works perfectly fine which uses OAuth where I get ...
0
votes
0answers
81 views

External Services Flow returning null

I've created a flow to utilize an External Service, however, the flow appears to be returning a null object response despite the 200 status code. In addition, the flow doesn't seem to allow me to view ...
3
votes
1answer
60 views

How to use a Named Credential for custom authentication that needs more than username, password to generate a secure token(X-Auth-Token)?

Premise We're currently storing the following parameters used for integration with a home grown web service: username password tokenKey initVector The below code is used to generate an ...
0
votes
0answers
160 views

Auth Provider with per-user Named Credential

I have a custom AuthProviderPluginClass implementation that is working fine for authorization and the related registration handler in my community for External Identity users. I've configured the ...
0
votes
0answers
34 views

Used Named Credentials to Call Web Service in OTHER Domain [duplicate]

I have a named credential for Microsoft Access Control Service, this named credential is Authenticated, so I need the token to call another web service that isn't in the same domain for example the ...
0
votes
1answer
24 views

NamedCredential URL path and Endpoint Callout path is different

I have a requirement to integrate Salesforce with external system, the Endpoint APIs are provided and i am using Named Credentials for making the callouts using Apex: Below is the details for ...
0
votes
0answers
40 views

How to pass Username and password of Named Credentials in HTTP Get [duplicate]

I am trying to send an send a request using get method of HTTP Request and I need to pass the username and password of Named credentials in the URL as username as clientID and password as the client ...
0
votes
1answer
113 views

Using {!$Credential.OAuthToken} in an apex Class

I wrote the code below. HttpRequest req = new HttpRequest(); req.setMethod('GET'); req.setEndpoint('callout:namedCredential/services/apexrest/customRestAPIGetAccount`); req.setHeader('Authorization',...
1
vote
0answers
35 views

Verify if Named Credential is live

Is there a way in Apex to verify if a Named Credential is live, so to speak? Of course, I can hit the endpoint and check the status code, but I'm looking for a more native approach. Specifically, is ...
0
votes
0answers
36 views

How to migrate Named Credential profile access [duplicate]

To authenticate a named credential as a user in the org, ones profile has to have access to the named credential. This is done in the profile setup under the related list "Enabled Named Credential ...
2
votes
0answers
140 views

Salesforce Named Credentials JWT token exchange (outbound) [duplicate]

For server to server integration between two salesforce org. I have used JWT exchange token authentication. I found a difference between JWT created via Apex Auth.JWTBearerTokenExchange and Named ...
0
votes
1answer
47 views

Access to merge fields of Named credentials in apex context

I have to provide OAuth access token to a JS SDK, The JS is uploaded in Static resource and referenced in visualforce JS_SDK.accessToken = '{!my_access_token}'; From Named credential documentation, ...
2
votes
1answer
33 views

Can I use Named Credentials with my SOAP service that requires authentication in the envolope?

My SOAP payload has an authentication node within the payload like this: <CustomInterface> <Header> <Environment>Sandbox</Environment> <Login> <User>...
0
votes
0answers
35 views

Named credential access

I have defined a 'Named Credential' in my org with type Named Principal, which as per https://help.salesforce.com/articleView?id=named_credentials_define.htm&type=5 means 'one user for the whole ...
2
votes
0answers
40 views

Can you put named credential username and password in the endpoint [duplicate]

The short- is there any way to use named credential merge fields in the actual named credential callout's endpoint (in the query string) There is an api that I need to make a callout to in salesforce ...
0
votes
0answers
329 views

Setting up Named Credential for External Rest API with OAuth2.0

I am trying to understand how to set up the Named Credentials & OAuth Provider in Salesforce for calling the External REST API. Before setting this up I tested the call to the REST API through ...