mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 06:22: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);
|
//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?
|
//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;
|
context.User = result.Principal;
|
||||||
|
|
||||||
if (context.User.Identity.IsAuthenticated)
|
if (context.User.Identity.IsAuthenticated)
|
||||||
|
@ -150,27 +150,20 @@ namespace Ocelot.DependencyInjection
|
|||||||
{
|
{
|
||||||
services.AddIdentityServer(identityServerConfiguration, configurationRoot);
|
services.AddIdentityServer(identityServerConfiguration, configurationRoot);
|
||||||
}
|
}
|
||||||
services.AddSingleton(services);
|
|
||||||
|
|
||||||
|
// public static IServiceCollection AddScheme<TOptions, THandler>(this IServiceCollection services, string authenticationScheme, Action<TOptions> configureOptions)
|
||||||
Action<AuthenticationSchemeBuilder> builder = schemeBuilder =>
|
Action<IdentityServerAuthenticationOptions> options = o =>
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
services.AddAuthentication(x =>
|
|
||||||
{
|
|
||||||
x.AddScheme("", );
|
|
||||||
})
|
|
||||||
.AddIdentityServerAuthentication(o =>
|
|
||||||
{
|
{
|
||||||
o.Authority = "http://localhost:51888";
|
o.Authority = "http://localhost:51888";
|
||||||
o.ApiName = "api";
|
o.ApiName = "api";
|
||||||
o.RequireHttpsMetadata = false;
|
o.RequireHttpsMetadata = false;
|
||||||
o.SupportedTokens = SupportedTokens.Both;
|
o.SupportedTokens = SupportedTokens.Both;
|
||||||
o.ApiSecret = "secret";
|
o.ApiSecret = "secret";
|
||||||
});
|
};
|
||||||
|
|
||||||
|
services.AddScheme<IdentityServerAuthenticationOptions, IdentityServerAuthenticationHandler>("IdentityServer", "IdentityServer", options);
|
||||||
|
|
||||||
|
services.AddScheme<IdentityServerAuthenticationOptions, IdentityServerAuthenticationHandler>("IdentityServerIdentityServerAuthenticationJwt", "IdentityServerIdentityServerAuthenticationJwt", options);
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user