-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authorization not working #115
Comments
Hi @jitesh95 - you have to use a URL callback scheme that is not http or https. The scheme should be unique, for example, "myscheme" or "myapp" I'll post some examples shortly. |
Thanks Mike for quick reply, if you could share some screenshots , that would be really great. |
Hi Mike, I will really appreciate some help here. I have some questions regarding the authentication of user in salesforce before calling the salesforce apis.
This i have to do in swift only, because once user is registered i have to redirect user to second screen where user can see Einstein chat bot upon successful email id match in contact database in salesforce. |
Hi @jitesh95 - the short answer is 'yes,' you could do what you're proposing but it's strongly recommended not to. Native mobile apps should use the OAuth2 'user-agent' flow, which is the default implementation for Swiftly Salesforce. Hard-coding usernames and passwords in the app presents a security vulnerability. The app likely wouldn't pass the Salesforce security review. Also, the user-agent flow relies on the Salesforce-presented login screen so your app never handles the user's name and password. That helps users trust your app since they aren't handing over their Salesforce credentials to a third-party, but only to Salesforce. If you use the default authentication behavior in Swiftly Salesforce then users won't have to re-authenticate. The session token is stored securely in the keychain and then retrieved for subsequent calls to Salesforce. |
@jitesh95 - one more point: if you're considering sharing a single Salesforce user credential among multiple mobile app users, that may violate Salesforce's service agreement. If you want to make a resource available to mobile users without authentication, consider a Heroku endpoint, Force.com sites or unauthenticated Community access instead. |
@jitesh95 a few notes on your code samples and info.plist file screenshot:
|
@jitesh95 I'll close this issue for now. Please re-open and comment if you still have questions/issues. |

Hi Mike,I am trying to query some records from salesforce using Swiftly . I have follwed the steps from importing library till schemes configuration. But still not i am not able to get data from salesforce. I think there is the is an issue with my callback url .
I have set up this callback url in salesforce connected app : https://callback-url.net
For this , info.plist file i have added an entry:
CFBundleURLTypes
CFBundleURLName
SalesforceOAuth2CallbackURLScheme
CFBundleURLSchemes
https://callback-url.net
Also fot ATS:
NSAppTransportSecurity
NSExceptionDomains
salesforce.com
NSExceptionRequiresForwardSecrecy
NSIncludesSubdomains
I have attached my code snippet also. Could you please help me out with this.

The text was updated successfully, but these errors were encountered: