ehrnst / System-Center-Operations-Manager-API

Microsoft System Center Operations Manager (SCOM) Web API
http://adatum.no/operationsmanager/web-api-for-scom
MIT License
41 stars 7 forks source link

Anonymous auth #27

Closed atriumcarceri closed 3 years ago

atriumcarceri commented 5 years ago

Hello! Is that possible, to not use windows auth, but use anonymous with some credential? I tried to realize it, with application pool, used domain acc with scom right's, but here what i get:

{

    "Message":"An error has occurred.",
    "ExceptionMessage":"An error occurred when trying to create a controller of type 'SCOMAlertController'. Make sure that the controller has a parameterless public constructor.",
    "ExceptionType":"System.InvalidOperationException",
    "StackTrace":" at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)\r\n at System.Web.Http.Controllers.HttpControllerDescriptor.CreateController(HttpRequestMessage request)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()",
    "InnerException":{
        "Message":"An error has occurred.",
        "ExceptionMessage":"An anonymous identity cannot perform an impersonation.",
        "ExceptionType":"System.InvalidOperationException",
        "StackTrace":" at System.Security.Principal.WindowsIdentity.Impersonate(StackCrawlMark& stackMark)\r\n at System.Security.Principal.WindowsIdentity.Impersonate()\r\n at SCOM_API.Controllers.SCOMAlertController..ctor()\r\n at lambda_method(Closure )\r\n at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)"
    }

}
ehrnst commented 5 years ago

Hi Roman,

I believe that will require a great deal of rewrite. I designed the API to leverage SCOMs own RBAC using impersonation. Feel free to look in to a change, I don't see when i will have the time or if I actually know how to change it.

On Wed, Mar 6, 2019 at 11:26 AM Roman Havrilyuk notifications@github.com wrote:

Hello! Is that possible, to not use windows auth, but use anonymous with some credential? I tried to realize it, with application pool, used domain acc with scom right's, but here what i get:

{

"Message":"An error has occurred.",
"ExceptionMessage":"An error occurred when trying to create a controller of type 'SCOMAlertController'. Make sure that the controller has a parameterless public constructor.",
"ExceptionType":"System.InvalidOperationException",
"StackTrace":" at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)\r\n at System.Web.Http.Controllers.HttpControllerDescriptor.CreateController(HttpRequestMessage request)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()",
"InnerException":{
    "Message":"An error has occurred.",
    "ExceptionMessage":"An anonymous identity cannot perform an impersonation.",
    "ExceptionType":"System.InvalidOperationException",
    "StackTrace":" at System.Security.Principal.WindowsIdentity.Impersonate(StackCrawlMark& stackMark)\r\n at System.Security.Principal.WindowsIdentity.Impersonate()\r\n at SCOM_API.Controllers.SCOMAlertController..ctor()\r\n at lambda_method(Closure )\r\n at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)"
}

}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ehrnst/System-Center-Operations-Manager-API/issues/27, or mute the thread https://github.com/notifications/unsubscribe-auth/AUXido6lGvRWvYFNt-93k33deAEpmI7Vks5vT5fHgaJpZM4bgixt .