Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ protected void Application_Start()
BundleConfig.RegisterBundles(BundleTable.Bundles);

// <snippet_SystemWebAdapterConfiguration>
SystemWebAdapterConfiguration.AddSystemWebAdapters(this)
.AddProxySupport(options => options.UseForwardedHeaders = true)
.AddRemoteAppServer(options =>
{
options.ApiKey = ConfigurationManager.AppSettings["RemoteAppApiKey"];
})
.AddAuthenticationServer();
HttpApplicationHost.RegisterHost(builder =>
{
builder.AddSystemWebAdapters()
.AddProxySupport(options => options.UseForwardedHeaders = true)
.AddRemoteAppServer(options =>
{
options.ApiKey = ConfigurationManager.AppSettings["RemoteAppApiKey"];
})
.AddAuthenticationServer();
});
// </snippet_SystemWebAdapterConfiguration>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ public class Global : HttpApplication
{
protected void Application_Start()
{
SystemWebAdapterConfiguration.AddSystemWebAdapters(this)
.AddJsonSessionSerializer(options =>
{
// Serialization/deserialization requires each session key to be registered to a type
options.RegisterKey<int>("test-value");
options.RegisterKey<SessionDemoModel>("SampleSessionItem");
})
// Provide a strong API key that will be used to authenticate the request on the remote app for querying the session
// ApiKey is a string representing a GUID
.AddRemoteAppServer(options => options.ApiKey = ConfigurationManager.AppSettings["RemoteAppApiKey"])
.AddSessionServer();
HttpApplicationHost.RegisterHost(builder =>
{
builder.AddSystemWebAdapters()
.AddJsonSessionSerializer(options =>
{
// Serialization/deserialization requires each session key to be registered to a type
options.RegisterKey<int>("test-value");
options.RegisterKey<SessionDemoModel>("SampleSessionItem");
})
// Provide a strong API key that will be used to authenticate the request on the remote app for querying the session
// ApiKey is a string representing a GUID
.AddRemoteAppServer(options => options.ApiKey = ConfigurationManager.AppSettings["RemoteAppApiKey"])
.AddSessionServer();
});
}
}
17 changes: 10 additions & 7 deletions aspnetcore/migration/fx-to-core/inc/remote-app-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Remote app setup
author: wadepickett
ms.author: wpickett
monikerRange: '>= aspnetcore-6.0'
ms.date: 09/16/2025
ms.date: 10/08/2025
ms.topic: article
uid: migration/fx-to-core/inc/remote-app-setup
zone_pivot_groups: migration-remote-app-setup
Expand Down Expand Up @@ -61,12 +61,15 @@ To configure the application to be available to handle the requests from the ASP
```CSharp
protected void Application_Start()
{
SystemWebAdapterConfiguration.AddSystemWebAdapters(this)
.AddRemoteAppServer(options =>
{
// ApiKey is a string representing a GUID
options.ApiKey = ConfigurationManager.AppSettings["RemoteAppApiKey"];
});
HttpApplicationHost.RegisterHost(builder =>
{
builder.AddSystemWebAdapters()
.AddRemoteAppServer(options =>
{
// ApiKey is a string representing a GUID
options.ApiKey = System.Configuration.ConfigurationManager.AppSettings["RemoteAppApiKey"];
});
});

// ...existing code...
}
Expand Down