Skip to main content

New answers tagged

0 votes

Correctly grant access to packaged Named Credentials

I've been looking to do this for the last 24 hours, and I've somewhat inadvertently stumbled over something that works at last. The situation is as follows. I want to call some Google Cloud services. ...
dyson's user avatar
  • 237
0 votes

Get all named credentials using connectAPI

Named credential is also exposed by SOQL: select id, DeveloperName from NamedCredential
Sigge's user avatar
  • 41
1 vote

How to catch "System.UnexpectedException: Unable to fetch the OAuth token."

I've struggled with this exception - it happened when named credential becomes invalid. You can't cach an unexpected exception. The execution thread will abort immediately. However it's possible to ...
Sigge's user avatar
  • 41
2 votes

How to catch "System.UnexpectedException: Unable to fetch the OAuth token."

Why don't you use Nebula Logger which supports recording of most Apex logs including Queueable jobs. Basically you just install the unlocked package to your sandbox. Then call the Logger method as in ...
compski's user avatar
  • 1,367
2 votes

Get all named credentials using connectAPI

The issue is that you are attempting to call this method on the ConnectApi.NamedCredentialList Class, when the method actually belongs to the ConnectApi.NamedCredential Class. You should be calling it ...
Callum MacErlich's user avatar
0 votes

Manually Invoke Refresh on Custom AuthProviderPluginClass

Now it is possible to add additional response codes to trigger the token refresh for External Credentials with OAuth 2.0. In addition to 401 responses, refresh tokens after these HTTP status code ...
Damecek's user avatar
  • 2,005
1 vote

Is populating external credentials from VF using connectAPI safe from security review?

Your best bet is to ask the Security Review/Partner Support teams for clarification, but my initial reaction is that this should be acceptable. Named Credentials are purpose-built to keep ...
sfdcfox's user avatar
  • 500k
0 votes

UserName and Password in Request body of apex callout using Named Credentials

Here's the full updated code: HTTP auth = new HTTP(); HTTPRequest r = new HTTPRequest(); r.setEndpoint('callout:Named_CREDENTIAL'); string jsonBody = '{ "username" : "{!$Credential....
Alex Wilson's user avatar

Top 50 recent answers are included