mirror of
https://github.com/ditkrg/AuthorizationServerDemos.git
synced 2026-01-22 22:47:02 +00:00
don't check ssl certs 😬
This commit is contained in:
parent
dac893275a
commit
ecbba4c648
@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System.Net;
|
||||
|
||||
namespace OidcSamples.AuthorizationServer
|
||||
{
|
||||
@ -23,6 +24,10 @@ namespace OidcSamples.AuthorizationServer
|
||||
{
|
||||
services.AddControllersWithViews();
|
||||
|
||||
// Dirty Hack: Disable verifying SSL certificates 😬
|
||||
ServicePointManager.ServerCertificateValidationCallback +=
|
||||
(sender, cert, chain, sslPolicyErrors) => true;
|
||||
|
||||
services.AddCors(options =>
|
||||
{
|
||||
options.AddPolicy(name: "Default",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@ -14,6 +14,7 @@ using Microsoft.Net.Http.Headers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OidcSamples.TaxApp
|
||||
@ -30,6 +31,10 @@ namespace OidcSamples.TaxApp
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
// Dirty Hack: Disable verifying SSL certificates 😬
|
||||
ServicePointManager.ServerCertificateValidationCallback +=
|
||||
(sender, cert, chain, sslPolicyErrors) => true;
|
||||
|
||||
services.AddRazorPages();
|
||||
|
||||
services.AddControllersWithViews();
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@ -16,6 +16,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OidcSamples.TrafficPoliceApi
|
||||
@ -32,6 +33,10 @@ namespace OidcSamples.TrafficPoliceApi
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
// Dirty Hack: Disable verifying SSL certificates 😬
|
||||
ServicePointManager.ServerCertificateValidationCallback +=
|
||||
(sender, cert, chain, sslPolicyErrors) => true;
|
||||
|
||||
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap["sub"] = "sub";
|
||||
|
||||
services.AddCors(options =>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user