• janir
  • NEWBIE
  • 0 Points
  • Member since 2013
  • Senior Architect
  • Fluido

  • Chatter
    Feed
  • 0
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 2
    Replies
Hi,

I have implemented an angular cli app which is currently running in localhost and I have several connections to Salesforce instances. I am using oauth2 to authorize the app. Currently I am getting the refresh token to the app and when the access token expires I renew it with the refresh token.
Here I hit a CORS issues:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://login.salesforce.com/services/oauth2/token. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
The funny thing is that I can see in the network tab that it makes the call and it returns me the new access token but in the console I get error:
ERROR_HTTP_400: Access Declined

I am using jsforce with the proxyUrl setting for the connection but still getting the error.
I get the same error if I make a direct http call and not using jsforce.
It works for other authenticated calls, in those I don't get the CORS issue.

Any idea how to fix this ?

If I don't have the refresh token (implicit flow), how do I renew the access token ? It would be better not to have the refresh token in the browser but I couldn't figure out any other way of getting a new access token when it expires.

Does Salesforce support silent authentication like described here: https://www.scottbrady91.com/OpenID-Connect/Silent-Refresh-Refreshing-Access-Tokens-when-using-the-Implicit-Flow

-Jani
  • March 05, 2018
  • Like
  • 0
Hi,

The problem:
1. Create scratch orgs, create field in Account, pull down changes -> all fields are pulled
2. Deploy dx project to sandbox -> a lot of errors about some new standard fields in Account that can not be deployed (for example CleanStatus)
3. Remove fields from object metadata, deployment OK
4. Add new field to scratch org, pull down changes, all the account fields are downloaded again

Question:
Is it possible to pull only the changed field not all
Is it possible to create the scratch orgs based on some sandbox configuration (so that we don't have the additional standard fields) ?
Or is it possible to remove the fields any other way ?

-Jani
 
  • September 07, 2017
  • Like
  • 0
Hi,

I am receiving the following error after Spring 17 update in a test, prior to the update it was working fine

System.UnexpectedException: ; nested exception is: common.exception.ApiQueryException: FROM PermissionSet WHERE Label = ( 'YYYY', 'XXXX ) ^ ERROR at Row:1:Column:44 Bind variables only allowed in Apex code

Executed SOQL:

delete [SELECT Id, AssigneeId, PermissionSetId, PermissionSet.Label FROM PermissionSetAssignment WHERE AssigneeId IN :userSet AND PermissionSet.Label IN :userDeleteApp];

userDeleteApp is string set
Set<String> userDeleteApp = new Set<String>();

Any help would be appreciated,
Thanks,
-Jani
  • January 09, 2017
  • Like
  • 0
Hi,
Is it possible to stop the execution of the flow in apex classes / triggers so that I could put a breakpoint in the apex class and when I hit the breakpoint in the class it would stop the execution and I could step thru the code in the Eclipse IDE and inspect the variables ?
This is a very good way of learning how the code works and which code is executed in different scenarios.
This is possible in non-cloud normal app development with Java
I know that it is possible to set debug log statements in the code and then run thru the code and it would print the result but this is not nearly as easy as stepping thru the code.
Thanks, Jani
  • January 14, 2014
  • Like
  • 4
Hi,

I am developing an SF mobile app with oauth2 and when I am presented with the login dialog and login the RemoteAccessAuthorizationPage flashes and it then redirects to https://eu2.salesforce.com/setup/secur/null
I can see the authorization page with the Allow/Deny buttons for brief glimpse and then it redirects to the above non-existing url
Any idea why ?

Thanks, janir

This is the content of the page:

URL No Longer Exists
You have attempted to reach a URL that no longer exists on salesforce.com.

You may have reached this page after clicking on a direct link into the application. This direct link might be:
• A bookmark to a particular page, such as a report or view
• A link to a particular page in the Custom Links section of your Home Tab, or a Custom Link
• A link to a particular page in your email templates

If you reached this page through a bookmark, you are probably trying to access something that has moved. Please update your bookmark.

If you reached this page through any of the other direct links listed above, please notify your administrator to update the link.

If you reached this page through a link on our site, please report the broken link directly to our Support Team and we will fix it promptly. Please indicate the page you were on when you clicked the link as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using salesforce.com!
  • December 29, 2014
  • Like
  • 0
Hi,
Is it possible to stop the execution of the flow in apex classes / triggers so that I could put a breakpoint in the apex class and when I hit the breakpoint in the class it would stop the execution and I could step thru the code in the Eclipse IDE and inspect the variables ?
This is a very good way of learning how the code works and which code is executed in different scenarios.
This is possible in non-cloud normal app development with Java
I know that it is possible to set debug log statements in the code and then run thru the code and it would print the result but this is not nearly as easy as stepping thru the code.
Thanks, Jani
  • January 14, 2014
  • Like
  • 4
Hi,
Is it possible to stop the execution of the flow in apex classes / triggers so that I could put a breakpoint in the apex class and when I hit the breakpoint in the class it would stop the execution and I could step thru the code in the Eclipse IDE and inspect the variables ?
This is a very good way of learning how the code works and which code is executed in different scenarios.
This is possible in non-cloud normal app development with Java
I know that it is possible to set debug log statements in the code and then run thru the code and it would print the result but this is not nearly as easy as stepping thru the code.
Thanks, Jani
  • January 14, 2014
  • Like
  • 4
Hi,

I am developing an SF mobile app with oauth2 and when I am presented with the login dialog and login the RemoteAccessAuthorizationPage flashes and it then redirects to https://eu2.salesforce.com/setup/secur/null
I can see the authorization page with the Allow/Deny buttons for brief glimpse and then it redirects to the above non-existing url
Any idea why ?

Thanks, janir

This is the content of the page:

URL No Longer Exists
You have attempted to reach a URL that no longer exists on salesforce.com.

You may have reached this page after clicking on a direct link into the application. This direct link might be:
• A bookmark to a particular page, such as a report or view
• A link to a particular page in the Custom Links section of your Home Tab, or a Custom Link
• A link to a particular page in your email templates

If you reached this page through a bookmark, you are probably trying to access something that has moved. Please update your bookmark.

If you reached this page through any of the other direct links listed above, please notify your administrator to update the link.

If you reached this page through a link on our site, please report the broken link directly to our Support Team and we will fix it promptly. Please indicate the page you were on when you clicked the link as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using salesforce.com!
  • December 29, 2014
  • Like
  • 0