This repository has been archived by the owner on Aug 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Service Fabric On Premise with AD Integration 401 Unauthorized #46
Comments
Please refer to this issue for more details. |
I Solved it by deploy a Proxy service for the Service fabric service, that handles the authentication for us. private const int StreamCopyBufferSize = 81920;
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
// send every request to Service fabric api
app.MapWhen(ctx => true, appBuilder =>
{
appBuilder.Run(async context =>
{
var requestMessage = context.Request.ToHttpRequestMessage("localhost",19080);
try
{
var response = await Client.SendAsync(requestMessage);
using (var responseStream = await response.Content.ReadAsStreamAsync())
{
await responseStream.CopyToAsync(context.Response.Body, StreamCopyBufferSize, context.RequestAborted);
}
}
catch (Exception e)
{
await context.Response.WriteAsync(e.ToString());
context.Response.StatusCode = 500;
}
});
});
}
private static readonly HttpClient Client = new HttpClient(
new HttpClientHandler
{
UseDefaultCredentials = true,
})
{
BaseAddress = new Uri("http://localhost:19080")
}; And I changed the clustermanagementurl to the new Proxy Service Url |
To build on @pregress's answer, this is now even simpler with the
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Do you want to request a feature or report a bug?
Bug
What did you do?
Provider connection error: Service Fabric responded with error code 401 Unauthorized to request http://localhost:19080/Applications/?api-version=3.0 with body {}; retrying in 588.391017ms
What did you expect to see?
No providers found.
What did you see instead?
Output of
traefik version
: (What version of Traefik are you using?)What is your environment & configuration (arguments, toml, provider, platform, ...)?
Part of our cluster config.
If applicable, please paste the log output in DEBUG level (
--logLevel=DEBUG
switch)The text was updated successfully, but these errors were encountered: