We’re rewarding the question askers & reputations are being recalculated! Read more.

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.

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

PHP OAuth 2.0 JWT Bearer Token Flow

I am trying to obtain a JWT Bearer Token from Salesforce. I am trying to follow their documentation but am however unsuccessful. https://help.salesforce.com/articleView?id=remoteaccess_oauth_jwt_flow....
0
votes
2answers
15 views

Add custom claims to OpenId JWT Token - Web Server Authentication flow

We are using Keycloak to generate OpenId tokens, now they want to use Salesforce Identity to do that, the thing is that the have some custom claims in the JWT token that we are not able to include in ...
0
votes
0answers
10 views

How to prevent salesforce mobile android app from handling oauth links

Currently on both my web and mobile app, when initiating oauth, android asks the user if they want the link to open in either chrome or the salesforce mobile app. If the user selects the latter, auth ...
5
votes
1answer
106 views

Authorize Apex Rest API call using an Azure token

I'm new to the OAuth concept in Salesforce and looking for some pointers for my use-case. I'm not even sure if I'm framing my question correctly, but I'm trying to understand if I can invoke an Apex ...
4
votes
1answer
57 views

Specifying an expiration date/time when creating a JWT

I have a connected app that I would like to connect to using a JWT flow using a bearer token. Using anonymous Apex I have: // The consumer key for a connected app of mine String iss = '<MY ...
0
votes
0answers
19 views

Refresh token in Username-Password OAuth Authentication Flow [duplicate]

I am implementing an Android app that talks to Salesforce community. I would like to get the following inputs from the experts here. In Username-Password OAuth Authentication Flow, we will get only ...
1
vote
1answer
33 views

Authorization of clients (VS Code, Data Loader)

To use the OAuth protocol, you need to create a connected app on Salesforce. Through consumer key and secret key it is possible to implement different oAuth flows. But how does it work with Visual ...
5
votes
1answer
119 views

“Decryption Exception” errors on Named Credential

I have callouts that use a Named Credential and a Custom Oauth2 Auth Provider fail with this error response: Invalid parameter value "[hidden]" for parameter "Decryption Exception" A similar ...
0
votes
0answers
34 views

Overriding Mobile SDK 7.3 login screen for React Native

we are doing a custom development of a mobile app connected to SF with a connected App. I was wondering if there's any way to override the default salesforce login screen that pops up and use a view ...
1
vote
0answers
16 views

OAuth Authentication for Community Customer User [duplicate]

I am trying to connect from Salesforce an unrelated Salesforce instance through a community user. I can successfully authenticate using Postman, however I am having a bit of trouble converting this ...
3
votes
1answer
45 views

Oauth2 redirect_uri_mismatch except that it matches exactly

So I created a new Connected App in Salesforce - in a sandbox environment. In the app's settings I enabled OAuth with Full access and set the Callback URI to https://test.mydomain.com/tools/...
0
votes
2answers
36 views

oAuth - how to acquire an access token from another org via an Apex callout

I want to actually connect to a salesforce environment in the background and retrieve information there. I don't want to be redirected anywhere with a token in the url. I want to be able to get the ...
2
votes
1answer
58 views

How to retrieve Apex 'webservice' WSDL using oauth access token?

My Connected App authenticates using the OAuth 2 Username/password flow, which gives an "access_token" that I can use for authenticating REST queries via the "Authorization" HTTP header as a bearer ...
0
votes
1answer
24 views

Explanations OAuth protocol Digging Deeper Documentation

In the documentation it says that "Apps that use OAuth can also directly authenticate and access Salesforce resources without a user’s presence". What does it mean?Is it not necessary create a ...
1
vote
1answer
72 views

What is “Sfdx Auth Url” attribute used for?

Till now, I have been working with SFDX orgs using JWT cert based auth auth:jwt:grantor authenticating using browser using auth:web:login I recently came across the --verbose attribute which gives ...
4
votes
1answer
58 views

Does Salesforce support PKCE validation in Web server flow?

In Salesforce OAuth2.0 Web Server flow, there is an option to not require a client key. But I am not sure whether it supports OAuth 2.0 RFC 7636: https://oauth.net/2/pkce/, which is the PKCE ...
0
votes
1answer
24 views

Can Protected Managed Package Custom Settings be used to store OAuth2.0 Credentials from a Custom Auth Provider?

Background: I have created a custom Auth. Provider in Salesforce to reach out to an authorization server that isn't on the default list of Provider Types. I used https://developer.salesforce.com/docs/...
2
votes
1answer
51 views

Overriding the final destination of the OAuth2.0 flow from a custom OAuth2.0 Auth provider

Background: I have created a custom Auth. Provider in Salesforce to reach out to an authorization server that isn't on the default list of Provider Types. I used https://developer.salesforce.com/docs/...
0
votes
0answers
48 views

Need help for test class for JWT Auth

I need to cover below class . It is 91% covered but giving NoDataFound public class JWTOAuth{ public static string getAccessToken( Salesforce_Org__c o){ Auth.JWT jwt = new Auth.JWT(); ...
0
votes
1answer
23 views

oauth2 token request failure with bad client_id

I'm submitting a curl command to get an oauth token and it fails with a bad client_id. What am I missing I setup an Auth. Provider and used MTest as mu consumer key and MRestTest as my Consumer ...
0
votes
0answers
29 views

OAuth 2.0 Web server flow without require secret - is that a better option than user-agent flow? [duplicate]

In connectedApp setting, there is an option called require secret for web-server flow. If I understand that correctly, if we choose that option, when using web-server flow, after authentication, the ...
1
vote
1answer
51 views

JWT Unsupported Grant Type when calling from node.js app but fine from Postman?

I am having some issues with my node.js app that I have been testing. This app is supposed to authenticate with my Salesforce Sandbox using a JWT in order to get a new access token. The token is ...
0
votes
0answers
16 views

Am getting Outh Error 1800 while trying to login to salesforce from external application

Am getting Oauth 1800 error when I create a developer account with region as United states , and when i create a developer account with India or Australia am able to successfully sign in from ...
1
vote
2answers
93 views

Ruby - Salesforce OAuth 2.0 JWT Bearer Token Flow - invalid assertion

I am following this document as I try to implement the Salesforce OAuth 2.0 JWT Bearer Token Flow. There are a number of steps involved and I have tried them over and over again but I keep getting {"...
0
votes
0answers
16 views

Managed Package and API Authentication

I am using Lightning and creating a managed package and want to pull in external data in JSON format from a REST API that I am developing. I want to have a button some where in the UI that when ...
0
votes
1answer
69 views

OAuth 2.0 User-Agent flow, why is it okay to keep the refresh token when it is considered unable to protect the secret

When I read the oauth 2.0 flows, the user-agent flow states itself to be used when the application is unable to protect the secret. But in the user-agent flow it is okay to have a refresh token ...
1
vote
1answer
44 views

Decode JWT received from /v2/authorize

I'm developing an app for SalesForce Marketing cloud. For the authentication I have a web page loaded as iframe in the salesforce mc; in this page the customer performs the login to my platform. ...
0
votes
0answers
30 views

Canvas API authentication errors in the Salesforce Mobile SDK

We have an application that loads Salesforce Lightning content into a WKWebView. We are using the Salesforce Mobile SDK in our app, and users are authenticated in their Orgs with OAuth per our ...
2
votes
2answers
149 views

SSJS OAuth 2 Support?

I'm trying to obtain an OAuth 2 token through SSJS and getting a 400 error. Here's the code I'm using: <script type="javascript" runat="server"> Platform.Load("Core", "1.1.5"); var ...
0
votes
0answers
68 views

c# .NET Example of using JWT OAUTH flow with salesforce

Does anyone have an example of the JWT oauth implementation in c#? Thanks https://help.salesforce.com/articleView?id=remoteaccess_oauth_jwt_flow.htm&type=5
1
vote
2answers
99 views

How to test OAuth JWT authentication in SF CRM

I'm trying to implement and test JWT Bearer authentication, I've created a key pair on my local machine and created a connected app in my sandbox and uploaded my .crt file. Is there a way I can test ...
2
votes
1answer
60 views

Oauth throws “invalid_grant: user hasn't approved this consumer” randomly for Community Login profile

I have an OAuth JWT Bearer token flow set up like this: Admin approved users are pre-authorized all profiles added to approved list Relax IP restrictions api, refresh_token/offline_access oauth ...
1
vote
1answer
110 views

How to provide access to Salesforce REST API to external application without providing them Integration user credentials?

Our salesforce org needs to expose some functionality as a REST API class to an external app. We created the apex class(@RestResource(urlMapping='')), now to provide access to the external app : We ...
2
votes
1answer
91 views

JWT Error - user hasn't approved this consumer

I am trying to implement the OAuth 2.0 JWT Bearer Token Flow on my node.js app using these instructions, but I'm unable to authenticate successfully, getting this error: {"error":"invalid_grant","...
3
votes
1answer
47 views

Is OAuth 2.0 User-Agent Flow truly an Implicit Grant Type?

Is the Salesforce User-Agent Flow truly an "Implicit" grant type? It can most definitely issue a refresh token. And yet per RFC 6749 Section 4.2 Implicit Grant documentation... The implicit grant ...
0
votes
0answers
22 views

Auth Provider for Trello?

I've spent too many hours today trying to set up an Auth Provider + Named Credential for Trello's auth flow... I guess my question is, for those who have dealt with Auth Providers in SFDC, is this ...
3
votes
1answer
89 views

Apex callout to an OpenID Connect endpoint protected by PKCE code challenge

I'm trying to write Apex code that'll call an external API. The API is using OpenID Connect for authentication, meaning I'll have to first give consent in order to get an authorization code, then ...
1
vote
1answer
26 views

Consumer key and secret for connected canvas app

In a managed package we have a Connected canvas app, which will be connected to the central server from all of the Orgs which have installed the package. After the user installs the app exchange app, ...
2
votes
1answer
199 views

Named Credentials - What is the difference between JWT & JWT Token Exchange

When setting up a named credential with Identity Type as Named Principal, two options are shown for JWT : JWT & JWT Token Exchange Could anyone explain what is the difference between the two? ...
1
vote
0answers
37 views

OAuth Flow required every day. Otherwise Callout fails with 401

In a customer org, Api calls are made using a NamedCredential using an OpenIdConnect AuthProvider. I didn't configure this but my own code fails with 401 Unauthorized. When I going to the ...
12
votes
2answers
200 views

Initiate an oAuth flow via an Auth Provider

I use the Metadata API and the Apex wrapper to create an AuthProvider and NamedCredential after the installation of my managed package app. MetadataService.NamedCredential cred = new MetadataService....
3
votes
1answer
123 views

Using Named Credentials in OAuth 2 authentication (grant_type=password)

I want to get an access token from an external endpoint (HTTP callout to REST API) without hardcoding passwords. The external system expects a request with Oauth 2.0 authentication details provided in ...
0
votes
1answer
48 views

Client Credential call for OAuth 2.0 providing “unsupported_grant_type”

{"error": "unsupported_grant_type","error_description": "grant type not supported"} I am creating a app to connect Salesforce to communicate(app-myApp to app-salesforceApp). So we took the channel "...
0
votes
0answers
32 views

Run deploy on different sandbox with one slave Jenkins

I installed Jenkins with sfdx on a server AWS. I configured a pipeline that works well with no error. But when I have 2 pipelines deploying with the same slave on 2 different sandboxes, I have a ...
1
vote
1answer
26 views

Get scopes from an access_token

When i got an access_token using the OAUTH2 endpoint, is there any way to check which scopes it is valid for? E.g. call some endpoint to get a list of valid scopes.
0
votes
1answer
46 views

Customer.io: webhook access_token update

I'm trying to create a webhook from customer.io that will connect to Salesforce via the REST api. As part of that, I need to grab the access_token. This is fine for a while, but the token will ...
3
votes
2answers
78 views

Custom authentication provider - retrieving a parameter from url in initiate() method

We have a working external identity provider SSO Oauth 2.0 with custom apex provider. (External app redirects to a specific SF community) We need to extend it to accept a custom parameter from the ...
1
vote
1answer
29 views

Using curl to retrieve data from Apex: Where to get security token?

curl -v https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=<your_consumer_key>" -d "client_secret=<your_consumer_secret>" -d "username=<...
2
votes
2answers
47 views

Which endpoints are supported for OAuth2 token authorization?

Documentation says that for OAuth2 token authorization URL like login.salesforce.com should be used For authorization: https://login.salesforce.com/services/oauth2/authorize For token requests: https:...
1
vote
0answers
14 views

Exercise with Oauth2 flow's - need page with simulator

I want to practice connections of some of OAuth2 flows(user agent, webserver, device etc.) Have you guys know some pages when I can simulate flow types as IDP - I expect that salesforce will be my ...