Skip to main content

Questions tagged [accesstoken]

Filter by
Sorted by
Tagged with
1 vote
0 answers
32 views

PMD Security - ApexSuggestNamedCredential Violation for Experian Integration on OAuth 2.0

We encountered a security issue flagged as "ApexSuggestNamedCredential" on various Experian-related integrations (such as Commercial Credit, Business Search, etc.). To address this, we ...
AKHIL K M's user avatar
0 votes
1 answer
51 views

Connected Apps and Managed package and Tokens

Let me explain what I am trying to build. I am developing an LWC component that displays data from a custom object stored in another Salesforce org. To ensure that the target org is connected, users ...
nica's user avatar
  • 1,450
0 votes
1 answer
37 views

Does changing Salesforce callback url for a app invalidates the current Access or Refresh tokens?

Suppose I am changing the Callback URL of the salesforce app, will it invalidate the access and refresh token of the salesforce app which were generated via the previous callback URL?
Bhaskar Dabhi's user avatar
0 votes
0 answers
77 views

Jenkins - SF cli cannot seem to access SF_ACCESS_TOKEN in the environment

I am using sf org login access-token --instance-url https://myorg.my.salesforce.com --no-prompt to login to a Salesforce Org. On Jenkins, I am setting the SF_ACCESS_TOKEN environment variable. However,...
Amudh's user avatar
  • 103
-1 votes
1 answer
209 views

Access Token Expiration

I am writing a code to hit 3rd party integration system from salesforce. They have their api where they are using username password flow to authenticate while salesforce hits their system for first ...
Shri's user avatar
  • 1
-1 votes
2 answers
110 views

Can an access token be obtained from current logged in org?

Is it possible to obtain an access token from the Salesforce org that a user has currently logged into using a username and password to access an external web application? Have any of you tried this? ...
psa's user avatar
  • 5
0 votes
1 answer
285 views

How to add a custom claim to the access token obtained from Salesforce?

I want to add custom claims to the access token obtained from Salesforce Connected App. I have seen these 2 articles (OpenID Connect - adding custom attributes (claims) to id token and Adding custom ...
psa's user avatar
  • 5
0 votes
1 answer
70 views

Connecting standalone LWR SPA and Apex Class to get access token

I have created standalone LWR SPA with command npm init lwr@latest. And also I have created SFDX class to create Apex class and deploy the class. To use the API, I fetch the API like this: const ...
user149845's user avatar
0 votes
0 answers
56 views

Calling APIs via oAuth and fine-grained authorization

I have an external system calling my middleware which then calls Salesforce to retrieve some data. Users login to the external system via an External IDP and retrieve an Access/Refresh Token and an ID ...
some guy's user avatar
  • 153
0 votes
0 answers
89 views

oAuth - refresh token flow

I am trying to get a new access token via the refresh token when the current access token has expired: auth_url = 'https://login.salesforce.com/services/oauth2/token' payload = { "grant_type&...
Toivo Ranta's user avatar
1 vote
0 answers
73 views

Salesforce Marketing Cloud API SOAP Function Perform Automation - Login Failed error / SFMC - S3 Trigger Automation

I need to import the file from Amazon S3 bucket into Data Extension using Trigger Automation https://help.salesforce.com/s/articleView?id=sf.mc_as_define_a_file_trigger_automation.htm&type=5 For ...
Luiza Zdebska's user avatar
3 votes
1 answer
245 views

Getting REST API Token in Salesforce unsupported_grant_type

I want to invoke REST API of Salesforce (they are at: https://mySFDomain.my.salesforce.com/service/data/v57.0/composite - for example). On an Enterprise Edition org, I can access with request like: In ...
khoa_chung_89's user avatar
1 vote
0 answers
140 views

How to refresh token with OpenIdConnect as Identity provider?

I have setup an auth provider with Open Id Connect. It works well but I have an issue when I want to refresh the token. I'm using this line to get a token. Auth.AuthToken.getAccessTokenMap(auId, 'Open ...
AshBringer's user avatar
3 votes
0 answers
839 views

External Credential: Custom Headers not Working (in OAuth Client Credentials/Secret Flow )

I have an external system that exposes an API with 2 endpoints: Token endpoint: Receives an Id + a Secret in the Authorization header, and a custom value in the user-agent header, and returns an ...
Douglas Molina's user avatar
0 votes
1 answer
123 views

How to load (image) file using REST API using Acces Token in authorization Bearer?

Using an access token I can successfully receive Query responses. Now I would like to load an (image) file URL using the same method, but it returns a 302 redirect with JavaScript code to redirect (I ...
Z0q's user avatar
  • 3
0 votes
0 answers
173 views

Unable to access token from an external callout through Apex

I'm starting developing on Salesforce, and want to retrieve a token from a client webapi to access another api. The client gave some access details to connect to their webapi. It looks like this : url ...
kabrice's user avatar
  • 139
1 vote
2 answers
2k views

Set expiry time of OAuth access token at connected app level

I have seen a lot of stack exchange posts suggesting that the expiry time of the OAuth access token cannot be determined. It is dependent upon the session timeout policy set at user profile level and/...
tanfive7's user avatar
0 votes
1 answer
67 views

Should an Access Token be renewed for every call using JWT?

Using the OAuth 2.0 JWT Bearer Flow, when does the Access Token need to be renewed? Let's say the JWT Flow is used to send queries to Salesforce from time to time. Should one request a new Access ...
Z0q's user avatar
  • 3
2 votes
0 answers
81 views

When trying to call external API, keep having to re-autheticate despite receiveing Refresh Token from API

I have an application which sits in Salesforce. The application authenticates using the web browser flow, authenticating against an external API. Upon authentication, the external API returns an ...
Faith's user avatar
  • 21
0 votes
1 answer
561 views

Apex Callout - Use Named Credential Password Placeholder in setEndpoint [duplicate]

I've created an Apex class to call a custom rest api endpoint for a Snowflake database. The call is pretty basic in that you just include the token and a query in the endpoint Url. I would like to use ...
Jeff Callahan's user avatar
3 votes
1 answer
368 views

Do scratch orgs have weird behaviors with connected apps? Being given "Invalid_grant" with "user hasn't approved this consumer"

I have created a scratch org and installed a connected app to it. I've set the policy to "Admin Approved users are pre-authorized". I've given the connected app access to a permission set ...
Kiet T's user avatar
  • 31
0 votes
0 answers
109 views

OAuth Token Authentication Issue

Named Credentials is setup for "ABC" and same details we are storing in ABC_Metadata__mdt. Auth. Provider is setup for "ABC" and same details we are storing in ...
Nilesh's user avatar
  • 1
1 vote
0 answers
288 views

How to Configure Named Credentials in Salesforce for External Callouts Using Client ID and Client Secret?

I'm in the process of integrating Salesforce with an external service. In our scenario, an LWC page calls a method in its Apex controller. This method then initiates an external callout to obtain a ...
Akif's user avatar
  • 25
0 votes
0 answers
55 views

Problem fetching data extensions from child business units using server to server token via SOAP API

I am currently working on a solution where I can read/write to data extensions in the following folders using a user access token. Data Extensions Shared Data Extensions Salesforce Data Extensions ...
Kimkykie's user avatar
0 votes
0 answers
392 views

Storing tokens for custom token management

I'm working with an API that does not follow typical OAuth standards and requires custom headers for passing the token. Typically I would use Named Credentials, but due to the atypical pattern it is ...
S.B.'s user avatar
  • 2,141
-1 votes
1 answer
131 views

How to Use Dropbox Access Token of Visualforce Page in Different Apex Class To Make an HTTP Callout

I have created a visualforce page to get the code initially and after the code with redirect url I'm getting the Access Token of Dropbox. After that now I'm confused that How I can use this in the ...
VINOD's user avatar
  • 3
0 votes
1 answer
1k views

Salesforce External Credentials Custom Body

I was configuring external credentials in Salesforce, but I noticed, there's no Custom Body on it, is there any way to add it using OAuth 2.0 Authentication Protocol? I'm only seeing Custom Headers ...
Erick Villamayor's user avatar
0 votes
0 answers
215 views

Any way to bulk revoke oauth tokens

So I have an app that is managing several oauth access/refresh tokens and it would be great if I revoke all the tokens I have. I am aware of the Salesforce's revoke endpoint. But it seems I can only ...
CodeBaker's user avatar
  • 301
1 vote
3 answers
2k views

Generate jwt access token for integration user

I am trying to use the new integration user license with the Salesforce API Only System Integrations profile. I created a user with a password and given them a permission set with a type of Salesforce ...
Valeriy Kutsar's user avatar
0 votes
1 answer
529 views

Authentication API call for V1 access token doesn't work in Marketing Cloud?

I'm trying to get the v1 access token from a legacy package . Reference this DOC It is pretty straightforward POST https://YOUR_SUBDOMAIN.auth.marketingcloudapis.com/v1/requestToken Content-Type: ...
Duc Le's user avatar
  • 3,820
0 votes
1 answer
396 views

JWT Access token in salesforce

I'm struggling with a requirement. I have to generate an access_token with "header" and "payload" information encoded inside the value of the token, all of this using salesforce. I ...
Juan Antonio Flores's user avatar
-1 votes
1 answer
760 views

Token expiration for server-to-server flow

We have implemented a server-to-server flow in Java where our API server will make calls to Salesforce API. We followed the great example provided by Salesforce. However, there are two time-related ...
Eric Liprandi's user avatar
0 votes
1 answer
4k views

Unable to get an Access token using a named credential and getting a State not Send OAuth Error

I am trying to get SF access token using a named credential as that is the secure way as mention here: I am basically unable to login successfully and get the following error : No_Oauth_State&...
Strong Like Bull's user avatar
3 votes
1 answer
472 views

Where to store longer Oauth Access Tokens?

We are implementing a Custom OAuth flow not using NamedCredentials and AuthProviders. For the storage of the Access Token we planned on using a Protected Custom Setting modified by an LWC component (...
Robert Sösemann's user avatar
0 votes
1 answer
276 views

Max number of valid access tokens per client

We have observed that if you call SFMC Auth API in succession, you get different access token each time and all are valid till expiry. I wanted to know if there is some upper limit on number of valid ...
Omkar Mahajan's user avatar
0 votes
1 answer
359 views

Serialized Error when getting Access Token from Salesforce

I'm attempting to get the Salesforce Access Token using typescript and Axios. Unfortunately, I'm getting a Serialized Error. I can't figure out why. Can anyone assist me, please? import axios from '...
Huckleberry Carignan's user avatar
0 votes
1 answer
2k views

Connected App access token is generated but is immediately invalid

I have a connected app which used to work. I generated an access token and was able to use that access token to retrieve other data. However when I went back to the app after a few months of not ...
zeiddev's user avatar
  • 115
0 votes
1 answer
2k views

Getting "this session is not valid for use with the rest api" error when tried to fetch accounts & contacts data

I am completely new to Salesforce and its integration via REST API. I am writing a NodeJS server app to fetch and sync accounts and contacts data. I have configured my connected app with the following ...
Senthilkumar NJSP's user avatar
0 votes
0 answers
635 views

Is it possible to determine the reason an oauth/access token was revoked or expired?

We're using a 3rd party webform tool (FormTitan) that pushes data into Salesforce using an oauth connection. The connection was reset unexpectedly which caused the form to start failing. The message ...
duncanm's user avatar
  • 35
0 votes
1 answer
36 views

does the soql support passrole or assumerole?

our salesforce is SSO login, so means we don't know the users' credentials, but we can get the SFDC auth token and user profiles need to run the SOQL as the logged-in user, the hierarchy, the ...
Joey.Huang's user avatar
3 votes
1 answer
1k views

Comparing timestamps in SSJS

As the access token is valid for 20 mins in SFMC, I want to reuse the access token. Hence I tried to write the below code. What I am doing currently I have created a Data Extension called - tokens_DE ...
natlin's user avatar
  • 33
3 votes
1 answer
1k views

Unable to login due to missing access token parameter for Identity Service - iOS

We have a growing number of users that are getting the following error on iOS after logging in to the connected app: "Server Error Can't connect to the server: The following required parameters ...
Rozgonyi's user avatar
  • 627
0 votes
0 answers
343 views

SSO blocking Frontdoor URL logins

I'm using the frontdoor URL method to login to multiple orgs. Some have SSO and some don't. The setup works fine for all orgs. Except for one org... This org has SSO enabled and using the frontdoor ...
Harout Tatarian's user avatar
0 votes
0 answers
1k views

LWC: Trying to get Access token

I am trying to get an access token from parent salesforce org. Here is the code which I am using: fetch('https://test-dev-ed.my.salesforce.com/services/oauth2/token', { ...
Tamil's user avatar
  • 750
-3 votes
1 answer
145 views

Obtain all OAuthTokens from account

Iv'e came across this data object. I am wondering how can I fetch all of the token which are related to my account (and all of my end users as-well). I did not quite understand which and how to ...
user110170's user avatar
0 votes
2 answers
613 views

Get Salesforce access token from MC cloudpage?

I'm trying to get the Salesforce access token from a connected app in MC and can't get the response. I tried it on Postman through Form Data and could get the token though. Really appreciate who can ...
Duc Le's user avatar
  • 3,820
1 vote
1 answer
2k views

Salesforce OAuth flow - getting a new refresh token

I have setup OpenID to use Salesforce as the IDP for an external site. We are using embedded login and server side callback flow. I have a requirement to set the lifespan of the access token to 60 min ...
Ryan Werner's user avatar
1 vote
1 answer
624 views

How to prevent an user used only for integrations for logging in via interface?

In my ORG I have an user used for integrations purposes only. Some integrations are using oauth2 authentication so that third-party platforms connect to Salesforce directly. In other integrations was ...
Olavo Alexandrino's user avatar
0 votes
0 answers
716 views

Incorrect token in Salesforce Marketing Cloud (401)

I would like the get the External Key of the Data Extension related to the Journey Builder. From this step, I need to use the REST API integration and WSProxy. Then, to call the REST API, I need to ...
Ben Inm's user avatar
  • 23
0 votes
0 answers
912 views

How to increase Access Token lifespan more than 20 minutes in SFMC?

According to this documentation The lifetime of an access token is 20 minutes. They've also mentioned these considerations Follow these considerations when using the API directly and doing your own ...
compski's user avatar
  • 1,391