nativesoftcom / nativerest

Native REST API Client for Windows, macOS and Linux
https://nativesoft.com/nativerest
13 stars 1 forks source link

Bearer token field too short #4

Closed ArsProgramma-private closed 7 months ago

ArsProgramma-private commented 7 months ago

I have a bearer token that is created in a C#-RestApi like this:

builder.Services.AddAuthentication(opt => { opt.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; opt.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; opt.DefaultScheme = JwtBearerDefaults.AuthenticationScheme; }).AddJwtBearer(opt => { opt.IncludeErrorDetails = true; opt.SaveToken = true; opt.RequireHttpsMetadata = requireHttpsMetadata; opt.TokenValidationParameters = new TokenValidationParameters { ClockSkew = TimeSpan.Zero, ValidateIssuer = true, ValidateAudience = true, ValidateLifetime = true, ValidateIssuerSigningKey = true, ValidAudience = validAudience, ValidIssuer = validIssuer, ValidAlgorithms = new[] { SecurityAlgorithms.HmacSha256 }, IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(securityKey)) }; });

The resulting Bearer is about 671 chars long.

When I insert this into the Bearer-Authentication field the max-length of that field cuts of that bearer, rendering this totally useless for my API.

devulex commented 7 months ago

👋 @ArsProgramma-private, thank you for the detailed description of the problem. In version 1.9.0 the maximum token length has been increased to 8192 characters. The new release is available here nativesoft.com/nativerest.