Where is Episerver Salesforce connector configuration saved? - salesforce

Working with a site running Episerver with the Salesforce add-on to tie episerver forms to Salesforce. I enter username/password/token for my salesforce user in the salesforce connector configuration screen in episerver backend and it saves my credentials. I navigate to forms and can now see my salesforce fields to map the form fields to.
The issue is that the salesforce connection config keeps disappearing. After some time when returning to the salesforce connector config in the episerver admin, or going to a form and attempting to map fields, the salesforce connection is gone and my fields are no longer mapped. If I re-add the connection the field mappings return. Where is this configuration saved in the database and what could be causing it to overridden? Is there a way to configure default values in a web config instead?
Relevant Package Details:
EPiServer.CMS - v11.11.3
EPiServer.MarketingAutomationIntegration.Salesforce - v4.2.0
EPiServer.Marketing.Automation.Forms - v2.1.0
EDIT:
It looks like the salesforce connector setting gets saved to dbo.tblBigTable and dbo.tblBigTableReference. Those records get cleared on startup of the project when I run it locally, still not sure why. I can restart the dev server without these records being cleared:
Running something like the following shows where the connector name portion is saved. There are likely other entries in these tables for the other fields configured there.
select * from dbo.tblBigTable where String01 like '%my-connector-name%'
StoreName | ItemType | String01 | String02
Marketing_Automation_Connector_Credentials |
Episerver.Marketing.Connector.Framework.Data.ConnectorCredentialStoreData, Episerver.Marketing.Connector, Version=5.4.0.0, Culture=neutral, PublicKeyToken=null |
my-connector-name |
!!=!encrypt!=!!0...
select * from dbo.tblBigTableReference where StringValue like '%my-connector-name%'
Type | PropertyName | CollectionType | ElementType | StringValue
3 | ActiveConnectors |
System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 |
System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 |
my-connector-name

Cause of issue:
I ended up having to decompile Episerver's source code to find the issue. It turns out the issue is in EPiServer's Episerver.Marketing.Connector.Framework.MarketingConnectorManager.GetConnectorCredentials method, so this might not be specific to the Salesforce connector but any marketing connector. The problem is that when the credentials were created in our DEV environment they get encrypted in the database. When the credentials are then fetched later on in our Local instance there is an attempt to decrypt the credentials. If the credentials cannot be decrypted, EPiServer deletes them rather than throwing an error or saying no valid credentials found.
Workaround:
To get around this problem, you can add a machineKey tag to your web.config so that the decryptionKey is shared between local and dev environments:
<system.web>
<machineKey validationKey="YOUR_VALIDATION_KEY_HERE" decryptionKey="YOUR_ENCRYPTION_KEY_HERE" validation="SHA1" decryption="AES" />
....
</system.web>

Related

salesforce developer - SFDX: Retrieve Source from Org

I have Lightning Web Components called list.
And when I try to do SFDX: Retrieve Source from Org,
To get my classes from Apex class.
I get the following error:
20:32:09.428 Starting SFDX: Retrieve Source from Org
=== Retrieve Warnings
FULL NAME TYPE MESSAGE
───────── ──────────────────────── ──────────────────────────────────────────────────────────────────────
list LightningComponentBundle Entity of type 'LightningComponentBundle' named 'list' cannot be found
20:32:10.344 ended SFDX: Retrieve Source from Org
I need help,
Thanks!
I created a new project with the command:
SFDX: Create Project with Manifest
Then, I right-clicked on the package.xml file in the manifest folder,
and selected:
SFDX: Retrieve Source in Manefist from Org
This worked.
(not a real answer but too long for a comment)
What's the exact command you're running to fetch it. If the command you run doesn't explicitly mention username/alias - check what happens when you open the default org (sfdx force:org:open) - by using default org you might be connecting to wrong org and the component really isn't there.
Maybe "list" is a reserved keyword?
Can you definitely see the component in the org. Setup -> Lightning Components contains it? When you open the developer console, query (tick the "Tooling API" checkbox at the bottom!) and run
SELECT Id, FilePath, Format, Source
FROM LightningComponentResource
ORDER BY FilePath
Is the component in there somewhere? https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_lightningcomponentresource.htm
Do you have other tools available like Ant + Migration tool or even Workbench. You should be able to run a full metadata retrieve with package.xml similar to
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>LightningComponentBundle</name>
</types>
<version>52.0</version>
</Package>
In your question there might be possible these issues:
1- When you authorize your org with VS code then might be possible your org is different and when you retrieve that is different.
2- When you deploy your code after that can be possible you delete that file, then this error can be shown.
I hope you find the above solution helpful. If it does, please mark it as the Best Answer to help others too.
Thanks and Regards,
Suraj Tripathi

Unable to run MVC web application locally

I’ve been asked to make changes to an existing MVC website, unfortunately the original developer of this site is no longer at the company, there isn’t any documentation and nobody actually knows much about it other than it current runs in our test & live environments. groan
Anyway when I set the project as the starting project and run it I get the following lovely white error page:
Access is denied.
Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.
Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.
Not a massive amount for me to go on (for me at least).
So I checked in the web.config file and the authorization is set as:
<authorization>
<deny users=”?” />
</authorization>
If I change this to the code below I get a page saying it couldn’t be loaded, but it is a step further as I can at least get into the code a little.
<authorization>
<allow users="*"/>
</authorization>
The code does do some validation against Active Directory, which works, and I can get around that pesky security code by setting a break point and moving past the functionality. The code itself doesn’t do anything but return true if the user is valid (I move the breakpoint to this), or false if they are invalid. This is the only way I have been able to catch a breakpoint within my controller to see if anything happens, but nothing sticks out.
The code, as partial as it may be, is in a class which will use LINQ to get the right information.
public ReadOnlyCollection<Application> GetApplicationStatus()
{
using (ApplicationDBEntities context = new ApplicationDBEntities())
{
var results = (from parameters in context.Parameters
join application in context.ApplicationIds on parameters.ApplicationId equals application.ApplicationId1
where parameters.ParameterName.Equals("DateTime", StringComparison.OrdinalIgnoreCase) &&
!parameters.Application.Equals(0)
select new Application
{
ApplicationId = parameters.ServiceId,
ApplicationStatus = application.Status,
DateAdded = parameters.ParameterValue
}).ToList();
return new ReadOnlyCollection<Application>(results);
}
}
In the above code it will throw an EntityException when getting the results, the message in the exception is “The underlying provider failed on Open.” The specific line highlighted is var results = (from parameters in context.Parameters
With this I figured that either the code current live isn’t the same as what I have (hopefully not the case) or something else was up, which is when I spotted the Inner Exception message: Login failed for user 'NT AUTHORITY\\ANONYMOUS LOGON'.
The connection string is as follows:
<connectionStrings>
<add name="ApplicationDBEntities" connectionString="metadata=res://*/ApplicationDBModel.csdl|res://*/ApplicationDBModel.ssdl|res://*/ApplicationDBModel.msl;provider=System.Data.SqlClient;provider connection string="data source=MyServer;initial catalog=MyDB;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
The SQL database that it is trying to get the information from is one that I have direct access to. Could this be that the IIS account doesn’t have access or something? Are there any tips or hints to try and find the root cause of this problem?
In your connection string there is intergated security = true, that means that your site try to get data from sql with authentication as user that runs application pool of IIS.
So you should run your iis application pool by user that have rights on db and, may be, on on other resources of your site.
Another possibility is that there is sql user to go to db an you should change connection string in config file.

PivotViewer unable to display collection - only shows link to cxml file

I have been trying to develop a pivot viewer dynamic collection (from sample source code). My environment is IIS 6, Windows server 2003 and VS 2010. The collection works fine from VS2010, but when i publish the service through VS2010, the collection does not load. The main page is shown with only the link to cxml file. I have added the three mime entries and clientaccesspolicy.xml is already copied by VS. Is there something missing in my configuration?
Use Fiddler to check the traffic with the app, where does it get stuck, does it get the .cxml file, can it find the dzi and dsc files?
Did you add dzi and dzc mime types as allowed?
You can see this Stackoverflow question to learn how to do this in IIS 6:
How do I get the Silverlight Pivot Server application to run on IIS 6?
Aslo in case you are using the JIT sample code then in the PivotServer project there is web.config file where there are httpHandler configuration values that are meant to be used when running in VS only.
You should remove those when you're deploying:
The Visual Studio Development Server
uses these httpHandler configuration
values. To run the server under IIS,
comment these handlers so that IIS
will use the duplicate set of handlers
in the system.webServer section below.
<httpHandlers>
<add path="*.cxml" verb="GET" type="PivotServer.CxmlHandler"/>
<add path="*.dzc" verb="GET" type="PivotServer.DzcHandler"/>
<add path="*.dzi" verb="GET" type="PivotServer.DziHandler"/>
<add path="*/dzi/*_files/*/*_*.jpg" verb="GET" type="PivotServer.DeepZoomImageHandler"/>
<add path="*_files/*/*_*.jpg" verb="GET" type="PivotServer.ImageTileHandler"/>
</httpHandlers>
Add a handler to the Loading Fail event and look at the exception?
PivotViewer.CollectionLoadingFailed += new EventHandler< CollectionErrorEventArgs >( PivotViewer_CollectionLoadingFailed );

DomainService only works with EDMX file?

I want to add a new domain service class within vs2010. I choose my entity framework database context in the dialog "Add New Domain Service Class", but it doesen't show me the available entities. If I click "ok" VS2010 gives me the following error message:
---------------------------
Microsoft Visual Studio
---------------------------
Value cannot be null.
Parameter name: ssdlPath
---------------------------
OK
---------------------------
The reason for this is, that I don't have an EDMX file (I tried it with an EDMX file and it worked). Instead I have a seperate csdl, msl and ssdl file. This is because I want to support multiple databases.
How can I use the class LinqToEntitiesDomainService with my data context? The entity objects and the data context are generated with the POCO template. If I add the Domain Serive class manually (not using the domain service wizzard) I get a compile time error which says basically the same:
MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(303,5): error : Value cannot be null.
MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(303,5): error : Parameter name: ssdlPath
Can anyone help?
Select YorDoaminContainer.csdl,YorDoaminContainer.ssdl file and the YorDoaminContainer.msl file and then
In Properties, set Build Action to Embedded Resource.
And then make sure you have correct connection string for this three resources.
for example:
<connectionStrings>
<add name="DomainModel"
connectionString="metadata=res://*/NameSpace.DomainController.csdl|res://*/NameSpace.DomainController.ssdl|res://*/NameSpace.DomainController.msl;
provider=System.Data.SqlClient;provider connection string='Data Source=localhost;
Initial Catalog=DB;Integrated Security=True;Connection Timeout=60;
providerName="System.Data.EntityClient" />
</connectionStrings>

dotnetnuke up and running error

I developed a DotNetNuke application and hosted it on a web server. When I browse the site, I am getting the following error:
Server Error in '/' Application.
Runtime Error Description: An
application error occurred on the
server. The current custom error
settings for this application prevent
the details of the application error
from being viewed remotely (for
security reasons). It could, however,
be viewed by browsers running on the
local server machine.
Details: To enable the details of this
specific error message to be viewable
on remote machines, please create a
<customErrors> tag within a
"web.config" configuration file
located in the root directory of the
current web application. This
<customErrors> tag should then have
its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web> </configuration>
Notes: The current error page you are
seeing can be replaced by a custom
error page by modifying the
"defaultRedirect" attribute of the
application's <customErrors>
configuration tag to point to a custom
error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly"
defaultRedirect="mycustompage.htm"/>
</system.web> </configuration>
Can any one tell me how to resolve the problem...
The main problem here is that you aren't getting any detail about what the error. Any success achieved while troubleshooting this without exposing some more detail (or knowledge of your setup) is going to be pretty close to pure luck.
I would suggest following the instructions that this default error message is giving you and editing the web. config file. The file is named "web.config" and it lives in the root of the website.
Open the file and search for "RemoteOnly", you should see something that says customErrors mode="RemoteOnly". Change the "RemoteOnly" to "Off" and save the file. The next time you browse to the site you should see a more detailed error message. Please share that with us here in the form of an update to your current post or as a new question (which I recommend, as it technically will be a different question).
Also, I recommend making a backup copy of the web.config file first before making any changes.
You need to check if your ASP.NET is functional. Since you didnt post any details on your web server, i would recommend you check if you have .NET 2.0 installed and your web server is configured to use it.
You can run aspnet_regiis -i in the c:\WINDOWS\Microsoft.NET\Framework\v2.x.x.x. directory to re-register the aspnet modules.
You might also want to check if your virtual directories have the execute permission enabled.
When you say you "developed a DotNetNuke application" I need more information.
Did you develop a DotNetNuke MODULE?
If so, did you install it on a DotNetNuke site that was working before, but isn't now?

Resources