Comments (5)
I like that option. It's not that different from just setting those options in SystemWebAdapters options directly, but it seems good to have remote app stuff separated out to keep things clear. I'll update things to work this way.
from systemweb-adapters.
Also RemoteApp and ApiKey exist on both session and auth, maybe those should be consolidated?
from systemweb-adapters.
I believe @mjrousos is handling that as part of his auth implementation.
from systemweb-adapters.
Sort of. This is a tricky one because, on the one hand, it feels bad to set these same values multiple times but, on the other hand, it also feels weird to configure things like ApiKey and RemoteAppUrl in core SystemWebAdapter configuration when those values aren't actually needed there (they're only needed for additional optional features like session sharing or auth sharing).
The way I've handled this in the auth PR so far is that I still require both session and auth configuration to set RemoteAppUrl and ApiKey, but I have both options types derive from a common base type with these properties so users can at least have code that sets these properties shared between both auth and session configuration.
I'm still not entirely happy with the solution, though, and think I will change it to have these properties set in SystemWebAdapter options even though they aren't used there. That's still not ideal but will be more readable.
Here's what using the approach in my auth PR currently looks like:
builder.Services.AddSystemWebAdapters()
.AddJsonSessionSerializer(options => RegisterSessionKeys(options))
.AddRemoteAppSession(ConfigureRemoteServiceOptions)
.AddRemoteAppAuthentication(o => ConfigureRemoteServiceOptions(o.RemoteServiceOptions));
void ConfigureRemoteServiceOptions(RemoteServiceOptions options)
{
options.RemoteAppUrl = new(builder.Configuration["ReverseProxy:Clusters:fallbackCluster:Destinations:fallbackApp:Address"]);
options.ApiKey = "strong-api-key";
}
If we set things in SystemWebAdapters instead, it would look like this:
builder.Services.AddSystemWebAdapters(options =>
{
options.RemoteApp = new(builder.Configuration["ReverseProxy:Clusters:fallbackCluster:Destinations:fallbackApp:Address"]);
options.ApiKey = "strong-api-key";
})
.AddJsonSessionSerializer(options => RegisterSessionKeys(options))
.AddRemoteAppSession()
.AddRemoteAppAuthentication();
from systemweb-adapters.
What about keeping it separate, but as a general remote app:
builder.Services.AddSystemWebAdapters(options =>
{
})
.AddJsonSessionSerializer(options => RegisterSessionKeys(options))
.AddRemoteApp(options =>
{
options.RemoteAppUrl = new(builder.Configuration["ReverseProxy:Clusters:fallbackCluster:Destinations:fallbackApp:Address"]);
options.ApiKey = "strong-api-key";
})
.AddRemoteAppSession()
.AddRemoteAppAuthentication();
And that would get plumbed through as an IOptions<RemoteAppOptions>
:
public class RemoteAppOptions
{
public Uri RemoteAppUrl { get; set; }
public string ApiKey { get; set; }
}
We could potentially use named options to disambiguate if people want multiple, but I don't see that as a required scenario at the moment.
from systemweb-adapters.
Related Issues (20)
- Add `Redirect` and `RedirectPermanent` to `HttpResponseBase` and `HttpResponseWrapper`. HOT 2
- HttpResponseBase.Cache is typed incorrectly as HttpCachePolicy; Causes MissingMethodException
- Remote Authentication to ASP.NET running in Azure App Services Does Not Appear to Work - User return is always not logged in, IsAuthenticated flag is False HOT 1
- [Test Issue] This is a test issue to verify the GitHub automation marks the issue as needing triage HOT 1
- 1.2.0 => 1.3.X `ISessionStateFeature` is not available HOT 2
- Some methods don't resolve on .NET Framework
- Upgrade System.Runtime.Caching to v8.0.0
- Switch to 1ES pipelines HOT 1
- Authentication Redirect Failing HOT 1
- add RequiresUniqueFilePathSuffix in the HttpCapabilitiesBase
- Help Needed: Blank Screen Issue with Microsoft Reverse Proxy in .NET Core HOT 5
- Session Values are set to Null if you dont map them
- error 500 (Internal Server Error) when I try to access the session HOT 3
- Roles are not converted to Claims on Login
- Confused about how to use Microsoft.AspNetCore.SystemWebAdapters while trying to port from old ASP.NET website to new ASP.NET Core web app HOT 1
- Add more functions to `HttpCachePolicy` HOT 2
- Unable to disable buffering once enabled HOT 5
- PreSendRequestHeaders and PreSendRequestContent should be fired when content is being sent HOT 3
- Net Core 8 Unable to resolve service for type 'Microsoft.AspNetCore.SystemWebAdapters.Authentication.IRemoteAppAuthenticationService' while trying to set up remote auth HOT 3
- When not buffering, flushing should cause `Response.End()` to be called HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from systemweb-adapters.