Created
March 5, 2018 03:26
-
-
Save dealproc/a47f8c17a0cb5364abc71238403fafe4 to your computer and use it in GitHub Desktop.
oauth config bits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// </summary> | |
/// <param name="app"></param> | |
/// <param name="env"></param> | |
/// <param name="loggerFactory"></param> | |
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | |
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) | |
{ | |
loggerFactory.AddConsole(Configuration.GetSection("Logging")); | |
if (env.IsDevelopment()) | |
{ | |
loggerFactory.AddDebug(); | |
app.UseSwagger(); | |
app.UseSwaggerUI(c => | |
{ | |
c.SwaggerEndpoint("/swagger/v1/swagger.json", "AdaptPOS TMS microservice API"); | |
}); | |
} | |
app.UseForwardedHeaders(new ForwardedHeadersOptions() | |
{ | |
ForwardedHeaders = ForwardedHeaders.All | |
}); | |
app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions | |
{ | |
Authority = "identity server hostname", | |
#if DEBUG | |
RequireHttpsMetadata = false, | |
#endif | |
AllowedScopes = new []{ "your api scope name" }, | |
ApiSecret = "{your api secret}", | |
ApiName = "{your api scope name}" | |
}); | |
app.UseMvc(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment