Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Internal server error, unable to login #315

Open
umardraz opened this issue Nov 21, 2022 · 1 comment
Open

500 Internal server error, unable to login #315

umardraz opened this issue Nov 21, 2022 · 1 comment

Comments

@umardraz
Copy link

umardraz commented Nov 21, 2022

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.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.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.<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.<b__0_0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.IIS.Administration.Cors.CorsExtensions.<>c.<b__0_2>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.IIS.Administration.Cors.CorsExtensions.<>c__DisplayClass0_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.IIS.Administration.ErrorHandler.Invoke(HttpContext context)
Event Xml:

0 2 0 0x80000000000000 1186316 Application udf-zlb-04

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
}
]
}
}

@dbContext
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants