I am trying to understand how the partner portal setup is working in my organization. My sincere apologies if this question is inappropriate for this forum?
Here is how the partner portal setup is in my company:
1) We have a portal user management section on the contact detail page showing some information(VF page) related to the partner portal.
2) For this VF, we have a controller and in that controller I see the below code:
public PageReference loginAsPortalUser(){
Contact con = new Contact(Id = currentId);
con.Portal_User_Notification_Type__c = 'Login As';
con.Portal_Token_Expiry_Date__c = Datetime.now().addMinutes(5);
update con;
con = [SELECT Id, Portal_Temporary_Token__c, Portal_Token_Expiry_Date__c FROM Contact WHERE Id =: currentId];
String portalServer = 'https://sometest.herokuapp.com';
if(UserInfo.getOrganizationId() == 'NNNSDFSWEZDSDSDCAA'){ // Prod Org Id
portalServer = 'https://company-portal-app.herokuapp.com';
}
PageReference newPage = new PageReference(portalServer + '/portal_user/login_as');
newPage.getParameters().put('expires', String.valueOf(con.Portal_Token_Expiry_Date__c.dateGMT()) + ' ' + String.valueOf(con.Portal_Token_Expiry_Date__c.hourGmt()) + ':' + String.valueOf(con.Portal_Token_Expiry_Date__c.minuteGmt()));
newPage.getParameters().put('contact_id', con.Id);
newPage.getParameters().put('token', EncodingUtil.urlDecode(con.Portal_Temporary_Token__c, 'UTF-8'));
return newPage;
}
3) Below image is the settings page for one of the partner portal:
My questions are :
- Why we have herokuapp in the controller code for the VF page?
- Is heroku needed to implement partner portal?
- How do partner portal users log into the partner portal? Is it by accessing the login URL in the second image?
- I understand that partner portal users are contacts in the salesforce then what do they use for userID and password when logging into the partner portal?
I think few of my questions are really dumb or may be I need to read the help document but I am really confused on how this partner portal setup is working in this particular case.
Can somebody please explain me on what is going on here? I tried to look up the partner portal implementation guide but could not find any. All I found is the salesforce online help and it does not have much details.
Please let me know if you need more details.
loginasPortalUser()
method; does it take you to the heroku app or does it redirect back to the salesforce partner portal?