mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-23 00:32:50 +08:00
messing around on mac trying to get something working..
This commit is contained in:
parent
fd9eae0152
commit
c1cfaf0fbb
@ -102,7 +102,8 @@ namespace Ocelot.Authentication.Middleware
|
||||
//auth.AddScheme(scheme);
|
||||
|
||||
//todo - call the next middleware to authenticate? Does this need to be on a different branch so it doesnt call any further middlewares?
|
||||
var result = await context.AuthenticateAsync(DownstreamRoute.ReRoute.AuthenticationOptions.Provider);
|
||||
var scheme = await auth.GetSchemeAsync("IdentityServer");
|
||||
var result = await context.AuthenticateAsync("IdentityServer");
|
||||
context.User = result.Principal;
|
||||
|
||||
if (context.User.Identity.IsAuthenticated)
|
||||
|
@ -150,27 +150,20 @@ namespace Ocelot.DependencyInjection
|
||||
{
|
||||
services.AddIdentityServer(identityServerConfiguration, configurationRoot);
|
||||
}
|
||||
services.AddSingleton(services);
|
||||
|
||||
|
||||
Action<AuthenticationSchemeBuilder> builder = schemeBuilder =>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
services.AddAuthentication(x =>
|
||||
{
|
||||
x.AddScheme("", );
|
||||
})
|
||||
.AddIdentityServerAuthentication(o =>
|
||||
// public static IServiceCollection AddScheme<TOptions, THandler>(this IServiceCollection services, string authenticationScheme, Action<TOptions> configureOptions)
|
||||
Action<IdentityServerAuthenticationOptions> options = o =>
|
||||
{
|
||||
o.Authority = "http://localhost:51888";
|
||||
o.ApiName = "api";
|
||||
o.RequireHttpsMetadata = false;
|
||||
o.SupportedTokens = SupportedTokens.Both;
|
||||
o.ApiSecret = "secret";
|
||||
});
|
||||
};
|
||||
|
||||
services.AddScheme<IdentityServerAuthenticationOptions, IdentityServerAuthenticationHandler>("IdentityServer", "IdentityServer", options);
|
||||
|
||||
services.AddScheme<IdentityServerAuthenticationOptions, IdentityServerAuthenticationHandler>("IdentityServerIdentityServerAuthenticationJwt", "IdentityServerIdentityServerAuthenticationJwt", options);
|
||||
|
||||
return services;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user