cancel
Showing results for 
Search instead for 
Did you mean: 

Logon Collector API

Jump to solution

I'm trying to query the MLC 3.0 API in order to get login information.  I'd like to use the ListAllLogins API.

The beginning of the doc mentions this:

Authentication is needed to access the APIs.

Should I use the Login API call for the authentication ?

If so, the documentation provides the following:

POST https://<MLC_IP>:<port>/rest/MLC/v1/bindingstore/{domain

{

"ipaddress": "192.168.1.1",

"username": "user1",

"computername": "computer1",

"logintime": "1405593089629",

"timeout": "28800"

}

I tried to create a login entry by using the following command:

curl -H "Content-Type: application/json" -X POST -d '{"ipaddress:<my ip address>","username:<my domain account>","computername:<my computer>","logintime:1443811496000","timeout:28800"}' https://<mlc server>:8444/rest/MLC/v1/bindingstore/{mydomain.example}

The server returning an "not authorized" error.

What am i doing wrong ?

1 Solution

Accepted Solutions
sliedl
Level 14
Report Inappropriate Content
Message 5 of 6

Re: Logon Collector API

Jump to solution

Here is the answer I got back from development:

"Yes, it is standard authentication which can be done through script. There are different options available.

For example, using curl, one can do a GET as below

curl -k -u admin:123 https://10.1.1.1:8444/rest/MLC/v1/bindingstore/mydomain.com

and a POST can be done as below

curl -i -k -u admin:123 -H "Content-Type: application/json" -X POST -d “{"ipaddress":"10.1.2.3","username":"user1","logintime":"1437370108462"}” https://10.1.1.1:8444/rest/MLC/v1/bindingstore/mydomain.com

here, admin is username and 123 is password .

This can also be done in python with using httplib or requests package. "

View solution in original post

5 Replies
Highlighted
Reliable Contributor exbrit
Reliable Contributor
Report Inappropriate Content
Message 2 of 6

Re: Logon Collector API

Jump to solution

Moved to Firewall Enterprise which I assume this is about.

---

Peter

Moderator

sliedl
Level 14
Report Inappropriate Content
Message 3 of 6

Re: Logon Collector API

Jump to solution

I forwarded your post to Development and this was their response:

"A http authentication to MLC server from the api client will do.

MLC server's username and password should be used for authentication (the one which is used to login into MLC UI)."

Re: Logon Collector API

Jump to solution

It looks like whenever I authenticate to the MLC console first, my queries to the API are accepted.

Here's what I'm trying to do though:

Via a script, I'd like to query the API for specific things like ListAllLogin or GetLoginForUser. If I run my script from a linux server that does not have a GUI, I can't really authenticate first.

Is there a way to authenticate myself to the MLC via a script instead of going through a browser ?

sliedl
Level 14
Report Inappropriate Content
Message 5 of 6

Re: Logon Collector API

Jump to solution

Here is the answer I got back from development:

"Yes, it is standard authentication which can be done through script. There are different options available.

For example, using curl, one can do a GET as below

curl -k -u admin:123 https://10.1.1.1:8444/rest/MLC/v1/bindingstore/mydomain.com

and a POST can be done as below

curl -i -k -u admin:123 -H "Content-Type: application/json" -X POST -d “{"ipaddress":"10.1.2.3","username":"user1","logintime":"1437370108462"}” https://10.1.1.1:8444/rest/MLC/v1/bindingstore/mydomain.com

here, admin is username and 123 is password .

This can also be done in python with using httplib or requests package. "

View solution in original post

Re: Logon Collector API

Jump to solution

that works. thanks !

More McAfee Tools to Help You
  • Subscription Service Notification (SNS)
  • How-to: Endpoint Removal Tool
  • Support: Endpoint Security
  • eSupport: Policy Orchestrator
  • Community Help Hub

      New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

    • Find Forum FAQs
    • Learn How to Earn Badges
    • Ask for Help
    Go to Community Help

    Join the Community

      Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

    • Get helpful solutions from McAfee experts.
    • Stay connected to product conversations that matter to you.
    • Participate in product groups led by McAfee employees.
    Join the Community
    Join the Community