• Iris Galeano
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hello! 

I have an application on Electron that uses the electron-oauth-helper library for oauth2. I provide the configuration for the oauth flow and the app displays the salesforce login page successfully. I enter my credentials for the login, select the Remember me checkbox and then login successfully. Later, when I logout and return to the login page my credentials are not saved and I have to write again my username and password. 

Is there a way I can configure maybe the oauth flow in order to have this button working? 

Any help with be appreciated! thank you! 
Hello. 

I have an app in React that needs to show the users' profile picture calling a web service expose in a force.com site. The app and the force.com site aren't related, so I don't have any valid sessionId or oauth_token. 

The force.com site exposes the web service using this class:
@RestResource(urlMapping='/UsersPhotos/*')
global class UsersPhotos {
    @HttpGet
    global static String doGet() {
    	String userId = RestContext.request.params.get('userId');
        ConnectApi.Photo ph = ConnectApi.UserProfiles.getPhoto(null, userId);
        return ph.fullEmailPhotoUrl;
    }
}

I implemented that solution (suggested here: https://sforcenotes.blogspot.com/2015/10/solution-to-display-salesforce-user.html?showComment=1596211057195#c5848226245946017759) because I don't want to use an oauth_token or custom object to store the users's profile pictures. But I got the following error in my app: 
 
[System.NoAccessException: Insufficient Privileges: You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.\n\nClass.ConnectApi.UserProfiles.getPhoto: line 266, column 1\nClass.UsersPhotos.doGet: line 7, column 1]

Can you please tell me If I need to add additional permissions in the force.com site? or another way to implement this?

Thanks.

 
Hello! 

I have an application on Electron that uses the electron-oauth-helper library for oauth2. I provide the configuration for the oauth flow and the app displays the salesforce login page successfully. I enter my credentials for the login, select the Remember me checkbox and then login successfully. Later, when I logout and return to the login page my credentials are not saved and I have to write again my username and password. 

Is there a way I can configure maybe the oauth flow in order to have this button working? 

Any help with be appreciated! thank you! 

Hello. I have a Force.com Site domain configured, and a Force.com site. The Force.com Site domain shows under Domains > My Domains. I can query the Site object, and it has the proper SubDomain value.

According to the docs, I should be able to query the Domain object and find this Force.com Sites domain. Also, there should be a DomainSite record linking the Site to the Domain. Right?

I query both the Domain and DomainSite objects (as a System Administrator), and both queries return no results.

I want to check, from Apex code (or using the Metadata API or something) whether there's a Force.com Sites domain set already on the org, and it's sub-domain component. Even when there are no sites created (I guess in that case I could query for a Site record with Type = Force.com Site, and use the SubDomain value?).

The final objective here, is being able to programatically create a Force.com Site. We intend to use the Metadata API for doing this.

Any ideas? Thanks!

  • September 28, 2016
  • Like
  • 1

Hello. I have a Force.com Site domain configured, and a Force.com site. The Force.com Site domain shows under Domains > My Domains. I can query the Site object, and it has the proper SubDomain value.

According to the docs, I should be able to query the Domain object and find this Force.com Sites domain. Also, there should be a DomainSite record linking the Site to the Domain. Right?

I query both the Domain and DomainSite objects (as a System Administrator), and both queries return no results.

I want to check, from Apex code (or using the Metadata API or something) whether there's a Force.com Sites domain set already on the org, and it's sub-domain component. Even when there are no sites created (I guess in that case I could query for a Site record with Type = Force.com Site, and use the SubDomain value?).

The final objective here, is being able to programatically create a Force.com Site. We intend to use the Metadata API for doing this.

Any ideas? Thanks!

  • September 28, 2016
  • Like
  • 1