Questions tagged [accesstoken]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
40 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
20 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
40 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
30 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
2 votes
0 answers
86 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
38 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
  • 59
0 votes
0 answers
106 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
  • 129
1 vote
2 answers
146 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
41 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
  • 59
0 votes
0 answers
172 views

end-user denied authorization

I'm trying to connect to Salesforce using Salesforce-CDP-jdbc driver and seems like I'm missing some grants and getting the error { "error": "access_denied", "...
StefanG's user avatar
  • 101
2 votes
0 answers
49 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
169 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
161 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
82 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
256 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
  • 15
0 votes
0 answers
38 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
205 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,071
-1 votes
1 answer
89 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
593 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
112 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
1k 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
371 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,208
0 votes
1 answer
241 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
554 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
3k 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
403 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
205 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
307 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
920 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
455 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
975 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
  • 617
0 votes
0 answers
284 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
  • 724
-3 votes
1 answer
78 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
420 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,208
1 vote
1 answer
1k 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
494 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
615 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
722 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,352
1 vote
1 answer
2k views

Integration to Salesforce through REST API without using consumer secret/key

I am trying to connect with the Salesforce via API call. I got the access token first by providing username, password, consumer key, consumer secret, grant_type. Then I used the access token and made ...
Kunal Das's user avatar
0 votes
1 answer
1k views

when I use in postman I recevie this error No_Oauth_State: State was not sent back

can you please resolve this issue when I try to get the new access token in the postman i receive this error No_Oauth_State: State was not sent back We can’t log you in because of the following error. ...
arun's user avatar
  • 13
4 votes
1 answer
527 views

API login after MFA enforcement

With the enforcement of MFA coming next year, I've started to test an API I wrote for a client that allows their website to talk to Salesforce. It's working fine right now, but if I enable High ...
Andrew Edmonds's user avatar
3 votes
1 answer
4k views

invalid_grant: expired access/refresh token [closed]

I'm facing a issue and I can't figure out how to fixed it. This month (2021, June) started with a issue, the access token of several clients aren't refreshing, request is getting 400 Bad Request ...
Ana's user avatar
  • 31
0 votes
1 answer
233 views

Does the accessToken from sfdx expire?

I posted earlier about the authentication with sfdx force:auth:device:login and the answer was "Sessions last indefinitely". So if that is the case, if I retreive the accessToken from sfdx ...
Chad H.'s user avatar
  • 73
0 votes
1 answer
828 views

OAuth Flow- Asp.net core and salesforce-how to fetch access token

using (var client = new HttpClient()) { var request = new FormUrlEncodedContent(new Dictionary<string, string> { { "...
Surabhi's user avatar
0 votes
1 answer
977 views

bulk api from postman is not working for me

I'm sure it's a minor thing I miss over here, but I'm trying to solve it for like 2 hours without luck. I'm trying to access the bulk API. When I'm doing it with workbench its works fine : /services/...
Salvation's user avatar
  • 1,189
0 votes
1 answer
499 views

Best authentication flow to use for Rest API without interacting or login to salesforce application?

We have web application that need to read & write data to Salesforce. For that, Web application have to authenticate with Salesforce and get access token. I refer all authentication flow mentioned ...
Viral's user avatar
  • 1