500 Internal server error, unable to login
Hi,
I have installed IIS Administration 6.0.0. on server 2016.
I had successfully generated Access Token But I am getting 500 internal server error whenever I tried API explorer using https://localhost:55539/#/api
Here is the event error logs
Log Name: Application Source: Microsoft IIS Administration API Date: 11/20/2022 11:28:22 PM Event ID: 0 Task Category: None Level: Error Keywords: Classic User: N/A Computer: udf-zlb-04 Description: Microsoft IIS Administration API encountered an unexpected error: System.ArgumentOutOfRangeException: The UTC time represented when the offset is applied must be between year 0 and 10,000. (Parameter 'offset') at System.DateTimeOffset.ValidateDate(DateTime dateTime, TimeSpan offset) at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync() at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync() at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync() at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme) at Microsoft.AspNetCore.Authorization.Policy.PolicyEvaluator.AuthenticateAsync(AuthorizationPolicy policy, HttpContext context) at Microsoft.AspNetCore.Mvc.Authorization.AuthorizeFilter.OnAuthorizationAsync(AuthorizationFilterContext context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.IIS.Administration.WebServer.Injector.Invoke(HttpContext context) at Microsoft.IIS.Administration.HeadTransform.Invoke(HttpContext context) at Microsoft.IIS.Administration.Startup.<>c.<<Configure>b__4_0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.IIS.Administration.Security.Authorization.AuthorizationPolicyMiddleware.Invoke(HttpContext context, IAuthorizationService authorizationService) at Microsoft.IIS.Administration.Security.WindowsAuthenticationExtensions.<>c.<<UseWindowsAuthentication>b__0_0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.IIS.Administration.Cors.CorsExtensions.<>c.<<UseCrossOrigin>b__0_2>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.IIS.Administration.Cors.CorsExtensions.<>c__DisplayClass0_0.<<UseCrossOrigin>b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.IIS.Administration.ErrorHandler.Invoke(HttpContext context) Event Xml: <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> <System> <Provider Name="Microsoft IIS Administration API" /> <EventID Qualifiers="0">0</EventID> <Level>2</Level> <Task>0</Task> <Keywords>0x80000000000000</Keywords> <TimeCreated SystemTime="2022-11-21T05:28:22.588958300Z" /> <EventRecordID>1186316</EventRecordID> <Channel>Application</Channel> <Computer>udf-zlb-04</Computer> <Security /> </System> <EventData>
Here is the appsettings.json file
{ "host_id": "8b9b1d66-9491-4383-a465-5024fa435a8c", "host_name": "IIS Administration API", "security": { "require_windows_authentication": false, "users": { "administrators": [ "UDF-ZLB-04\Administrator" ], "owners": [ "UDF-ZLB-04\Administrator" ] }, "access_policy": { "api": { "users": "Everyone", "access_key": true }, "api_keys": { "users": "administrators", "access_key": false }, "system": { "users": "owners", "access_key": true } } }, "logging": { "enabled": true, "min_level": "error", "file_name": "log-{Date}.txt", "LogLevel": { "Default": "Error", "System": "Error", "Microsoft": "Error" } }, "auditing": { "enabled": true, "file_name": "audit-{Date}.txt" }, "cors": { "rules": [ { "origin": "https://manage.iis.net", "allow": true } ] } }
it looks to be because they're using DateTimeOffset with a UTC DateTime so when generating a Forever Token, you're outside bounds IF your local server timezone isn't UTC. I had the same issue with a Forever Token, then updated my timezone to UTC, and worked fine after this.