Questions tagged [oauth2]
OAuth 2.0 is the next evolution of the OAuth protocol and is not backwards compatible with OAuth 1.0. OAuth 2.0 focuses on client developer simplicity while providing specific authorization flows for web applications, desktop applications, mobile phones, and living room devices.
881
questions
0
votes
0
answers
18
views
Trying to use a Global Connected App and JWT Flow to Get an Access Token in Other Salesforce Orgs
The method that I am trying:
Create a connected app in some namespaced org, enable it to use the JWT flow. The policy is set for all users can self-authorize. I upload a certificate to this app.
In ...
0
votes
1
answer
27
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 ...
-1
votes
0
answers
26
views
unsupported_grant_type from token URL for Salesforce Oauth 2
We are trying to perform Oauth 2 with Salesforce lightning sandbox environment. Using the Mule app given in https://help.salesforce.com/s/articleView?id=001116177&type=1
Getting below error:
{&...
2
votes
0
answers
44
views
Managed 2GP ExternalService NamedCredential callout using OAuth JWT bearer flow
I have a managed 2GP that I want to publish on AppExchange
This package uses triggers to make external service callouts (ex. https://example.com/api/v1/sfdata)
I want the callouts to be authenticated ...
0
votes
1
answer
19
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?
0
votes
0
answers
72
views
OAuth_Approval_Error_Generic just 1st time
My team is using React native on the Android Mobile SDK.
Every time the user selected a server, this OAuth error appeared and they were not allowed to log in at any time; after some modifications to ...
0
votes
0
answers
56
views
How to Address Security Warnings About Named Credentials When Handling OAuth in Apex?
I am preparing to submit my Salesforce application for review to list it on Salesforce AppExchange. My application uses a custom OAuth authentication flow handled by an LWC component and Apex. The ...
2
votes
0
answers
61
views
how to rotate just the consumerSecret on a connected app?
For a Connected App in Salesforce, can the consumerSecret be updated or changed apart from the consumerKey? And, can this be done programmatically? This documentation only gives a path through the UI, ...
0
votes
0
answers
133
views
Named Credential - Refresh access token when not 401?
I'm trying to connect to an external system using legacy Named Credential and a custom Auth. Provider (with AuthProviderPlugin class).
I'm able successfully call the endpoints when the access token is ...
0
votes
1
answer
109
views
Refresh Salesforce OAuth Refresh Token Before Expiry with Named and External Credentials
I'm currently facing an issue with Salesforce OAuth refresh tokens and would appreciate some guidance.
Problem:
I have a setup in Salesforce where I use Named Credentials and External Credentials to ...
-1
votes
1
answer
56
views
Is there a way to validate the web app authentication integation on SFMC?
https://${d(
subDomain,
)}.auth.marketingcloudapis.com/v2/authorize?response_type=code&client_id=${d(
clientId,
)}&redirect_uri=${config.sfmc.AltusRedirectUri};
This ...
0
votes
0
answers
154
views
No subject alternative DNS name matching found
Trying to make callout to an authentication provider and get the access token which I would be using in the consecutive callout with another endpoint. Was working fine Initially with all the endpoint ...
0
votes
0
answers
30
views
Creating a web app to upload files on Android
In order to get around the Salesforce Mobile app only allowing Android users to upload a single picture or file at a time, I created a simple web app that allows multiple files to be uploaded and ...
0
votes
1
answer
180
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 ...
0
votes
0
answers
93
views
How to convert Legacy Named Credentials to new External Credentials?
I have a set of legacy named credentials connecting from one SF org to another, using OAuth2 protocol.
Legacy credentials don't specify the Authentication Flow Type.
Instead, they attempt to log in to ...
1
vote
1
answer
46
views
How to set scope in Auth provider for extending token expiry on JIRA server?
While setting up named credentials or Auth provider using OAuth2 for connecting to Jira on premise, The incoming link in JIRA is configured correctly and I am able to pull data but the session expires ...
0
votes
0
answers
55
views
HMAC signing with Named Credentials and OAuth
Context
I'm setting up an External Data Source pointing to an OData API.
I've setup a Named Credential and an External Credential for it.
The External Credential is configured to use OAuth2.0 (JWT ...
1
vote
0
answers
236
views
How to migrate successfully from legacy FCM APIs to HTTP v1 in apex?
I have a working functionality for sending push notifications via Firebase (FCM) from apex. But it is legacy now and I need to upgrade to HTTP v1.
Based on the official documentation and the few ...
1
vote
0
answers
284
views
OAuth 2.0 Client Credentials Flow: no client credentials user enabled but the user is authorized
this is my first question here.
For starters, I've read all the other questions here, but I couldn't solve the problem.
The thing is, I had been using the sandbox environment without any major ...
0
votes
0
answers
53
views
Managed package - how to authorize access to orgs
We are attempting to connect one Salesforce org to multiple others (Production / Sandbox) using a web server login flow from a managed package. Our approach involves storing 'refresh_token' and '...
0
votes
0
answers
42
views
Any limitations on creating an OAuth Connected App in Salesforce Essentials edition?
Are there any limitations to creating an OAuth connected app in Salesforce Essentials edition vs the higher editions like Professional, Enterprise, etc.? Are there any restrictions that I should be ...
2
votes
1
answer
313
views
Safely Storing Client Credentials in Salesforce?
I'm trying to integrate with an external system using Authentication provider and Named credential.
For this, I've created an Auth. provider with just Auth URL, Callback URL and a plugin class. Client ...
0
votes
0
answers
43
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 ...
0
votes
0
answers
73
views
OAuth2 connection inconsistency using JSforce
My Nodejs app has the option for users to sign-in using their devOrg. And my app is establishing an OAuth2 connection using authorization code grant. The whole sign in works perfectly fine. After the ...
0
votes
0
answers
282
views
Help with auth. provider error: "Id_Token_Error: Missing id_token"
I am developing my own OpenIdConnect IdP for logging into my Salesforce. In Salesforce, I created two auth. providers. One is a custom auth. provider (and custom reg. handler), and the other is an ...
0
votes
0
answers
78
views
Google Cloud Connection Works with Apex Auth Class but not with Named Credentials
I have hosted an API on google cloud run and the downloaded the service account credentials in below format.
{
"type": "service_account",
"project_id": "...
3
votes
1
answer
140
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 ...
1
vote
0
answers
97
views
Is Salesforce's refresh token rotation working?
I have enabled the refresh token rotation for my connected app.
My expectation is that when I use my refresh token to acquire a new access token, the current refresh token should expire and a new ...
2
votes
1
answer
691
views
404 URL No Longer Exists with REST API Call
When submitting a GET request with either Postman or boomi, I receive the following 404 error.
‘You have attempted to reach a URL that no longer exists on salesforce.com’
In either tool, I can get the ...
4
votes
2
answers
2k
views
Getting the error : Unable to fetch the OAuth token when using an external credential with "Client Credentials with Client Secret Flow"
I am trying to make a webservice call to an authorization server (OAuth 2.0) using the "client_credentials" grant type, but i receive a "System.CalloutException: Unable to fetch the ...
0
votes
1
answer
108
views
Allow calls to most Salesforce APIs from Apex in Unlocked Package
This Apex code from an Unlocked Package
HttpRequest request = new HttpRequest();
request.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());
request.setHeader('Content-Type', '...
-1
votes
1
answer
261
views
How to create Auth Provider using APEX
I could see AuthProvider Object support Create() and Update(), But when i try to insert its throwing following error.
DML operations are not allowing on Auth. Provider
Code:
AuthProvider authPro = ...
0
votes
0
answers
75
views
Named Credential / External Credential Only Working Once
I've used a Named Credential with External Credential for the Client Credentials with Client Secret Flow.
I didn't find the documentation very helpful to be honest, but this super post helped me get ...
1
vote
2
answers
1k
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/...
0
votes
1
answer
53
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 ...
3
votes
1
answer
282
views
External/Named Credential - acquiring access token from Mule via client credentials flow
I want to configure Named&External Credentials with oAuth client credentials flow and use it in apex.
An endpoint is exposed by Mulesoft. I followed those very neat instructions shared here, but I ...
0
votes
0
answers
75
views
Programatically give a user access to an ExternalCredential Principal (Per User)
I try to find a way to programatically give a user access to an ExternalCredential Principal (Per User).
The standard way, is to go to personal settings and click "Allow Access".
I found out ...
0
votes
0
answers
143
views
Invalid Auth Header Using Run Flow In Another Org From UnofficialSf
When running the unlocked package Run Flow In Another Org I see a 400 Invalid_Auth_Header error in Debug Logs. Getting a successful response from Postman so I'm guessing something has changed in ...
0
votes
1
answer
1k
views
How to get Refresh Token in Postman in 2024?
I've been trying to get the refresh token using Postman without success. It seems from what I've found that some ways have changed over the years. I do have the request to get the access token, which ...
0
votes
1
answer
70
views
Handling Encoded Responses in Salesforce OAuth2 External Credentials
I'm dealing with a specific issue in Salesforce related to External Credentials with OAuth2 protocol. The main problem is that Salesforce doesn't properly accept encoded responses from our ...
-1
votes
1
answer
18
views
Making a web app that allows any salesforce org/user to sign up and see analytics
I'm creating a web application in which a user can "connect" their salesforce account to my web app and see analytics. I've currently looked at creating a connected app, but that only works ...
0
votes
0
answers
56
views
How to escape # in the redirect_uri for OAuth2?
I am redirecting user to salesforce for OAuth. It is giving me the error that unsupported response_type. When i debugged in the detail then i found that it is due to # in the url.
How can i escape #? ...
1
vote
1
answer
164
views
Web flow and access/refresh tokens via php
I'm trying to implement a web flow authentication process using php; so far, I've created the necessary index.php file which is used to get the first code:
// Generate a random code verifier
$...
0
votes
0
answers
121
views
OAUTH_DISALLOWED_SCOPES error when authorizing named credential
I am trying to create a named credential to authorize access to the Salesforce metadata API, as explained in this blog:
https://gscloudsolutions.com/tips-tricks/using-named-credentials-with-the-apex-...
0
votes
0
answers
718
views
External Credentials not making oauth call
I am attempting to implement the Named Credential/External Credential system following this post and am getting "System.CalloutException: Unable to fetch the OAuth token." error. Everything ...
1
vote
0
answers
204
views
External Credential Flow (Existing_link)
Struggeling to Authenticate to Microsoft AD With Open ID Connect using Named Credentials/External Credentials.
First of all: This approach works on all Salesforce Instances, now I have this issue on a ...
0
votes
0
answers
387
views
Named Credential with Basic Authorization Token, Username and Password details
I am trying to callout to an external application APIs to fetch data into Salesforce.
That external application has Auth token URL which will need below details to share Access token (bearer) to be ...
1
vote
1
answer
1k
views
Why is OAuth Client Credentials safer than OAuth Username-Password?
According to Salesforce, here
"You can use the username-password flow to authorize a client via a connected app that already has the user’s credentials. However, we recommend avoiding this flow ...
0
votes
0
answers
490
views
PKCE: Invalid Code Verifier
I am trying to implement the PKCE flow into my SPA. I have read a bunch of documentation including the salesforce docs, the RFC for PKCE flow and have watched this step by step instruction from a ...
0
votes
0
answers
218
views
How to specify audience for OAuth token in SF when configuring auth for an Azure protected API endpoint hosting external data?
I have an external data source hosted in Azure which is an OData API endpoint. Everything works well with auth disabled.
I created an application registration in Azure AD to represent the API and ...