ispysoftware/iSpy

How bypass authentication for Protect API?

kennethgomez01 opened this issue · 8 comments

I was wondering how would I call URL an api directly from Action, while protecting the api links by enabling "Protect API" from Local Server menu? I was trying to start an rtmp-view by calling the api url, while calling "http://user:pass@localhost:8090/?q.json?cmd=start-rtmp-view&ident=indent&ind=0" , or using the BASIC Auth header but it all causing an error from the log.

what are you putting in the header field and what error are you getting in the logs at /logs.html?

I just put the value for Basic Auth Header value that I got from the ispy official website after filling up my username and password (Admin account on my local ispy server) to generate these values, and placed this value in the Authorization Header field as format "BASIC value"

`

AM Process: {"error":"Uncheck Protect API in server settings - local server or provide Basic Authentication using an admin user account."}
`

ProcessAlertEvent: Cannot access a disposed object. Object name: 'System.Net.HttpWebResponse'. at System.Net.HttpWebResponse.CheckDisposed() at System.Net.HttpWebResponse.get_StatusCode() at CoreLogic.Objects.Helpers.AlertProcessor.ProcessAlertEvent(IAgentControl io, IAgentControl source, objectsActionsEntry ev, String message, String tags, String aijson, String filename, String zoneList)

ah looks like it's case sensitive, so should be
Basic YOURAUTH
will make it not case sensitive

I tried changing it to Basic MyAuth, and the problem still occured

I just want to protect the API from unauthorize users, while I can still access it freely.

working here -
image

image

logs:
Camera 1: ProcessAlertEvent: Processing URL (http://localhost:8090/command.cgi?cmd=getStatus)
ProcessAlertEvent: Response Code: OK

@ispysoftware Thanks ,I think the removing the extra punctuation and adding slash on the url makes it works.