1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

remove old token retrieval schemes

This commit is contained in:
Kyle Spearrin
2018-01-03 14:11:56 -05:00
parent 3251c4b574
commit f61acdd3b9
3 changed files with 1 additions and 59 deletions

View File

@ -9,9 +9,6 @@ using Microsoft.IdentityModel.Tokens;
using Bit.Api.Utilities;
using Bit.Core;
using Bit.Core.Identity;
using System.Linq;
using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.Net.Http.Headers;
using Newtonsoft.Json.Serialization;
using AspNetCoreRateLimit;
using Serilog.Events;
@ -20,7 +17,6 @@ using Bit.Core.Utilities;
using IdentityModel;
using IdentityServer4.AccessTokenValidation;
using jsreport.AspNetCore;
using Bit.Core.IdentityServer;
namespace Bit.Api
{
@ -84,8 +80,6 @@ namespace Bit.Api
options.RequireHttpsMetadata = !Environment.IsDevelopment() &&
globalSettings.BaseServiceUri.InternalIdentity.StartsWith("https");
options.NameClaimType = ClaimTypes.Email;
options.TokenRetriever = TokenRetrieval.FromAuthorizationHeaderOrQueryString(
new string[] { "Bearer", "Bearer3" });
options.SupportedTokens = SupportedTokens.Jwt;
});
@ -127,14 +121,7 @@ namespace Bit.Api
{
config.Filters.Add(new ExceptionHandlerFilterAttribute());
config.Filters.Add(new ModelStateValidationFilterAttribute());
// Allow JSON of content type "text/plain" to avoid cors preflight
var textPlainMediaType = MediaTypeHeaderValue.Parse("text/plain");
foreach(var jsonFormatter in config.InputFormatters.OfType<JsonInputFormatter>())
{
jsonFormatter.SupportedMediaTypes.Add(textPlainMediaType);
}
}).AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());
}).AddJsonOptions(o => o.SerializerSettings.ContractResolver = new DefaultContractResolver());
// PDF generation
if(!globalSettings.SelfHosted)