AnthonyMusgrove / Emby-ScripterX

Run custom external application or script (batch/bash/powershell/php/python/node.js/custom) on various events within the Emby Server.
https://emby-scripterx.com
78 stars 6 forks source link

ip address variable for onAuthentication* events #22

Closed nayrnet closed 4 years ago

nayrnet commented 4 years ago

As a Emby Admin I wish to pass through the user IP as a %ip% variable onAuthenticationFailed events so I can script up blocking at the edge firewall after too many failed login attempts.

AnthonyMusgrove commented 4 years ago

This is a great idea, leave it with me! :)

AnthonyMusgrove commented 4 years ago

Update: Just waiting on some information from Emby Dev team regarding the RemoteEndPoint data for the AuthenticationRequest (having an issue accessing the property: System.MissingMethodException: System.MissingMethodException: Method not found: 'System.String MediaBrowser.Controller.Session.AuthenticationRequest.get_RemoteEndPoint()'.) .. Will update you as soon as I get it working :)

AnthonyMusgrove commented 4 years ago

Bingo, got it.

2020-05-17 17:19:57.803 Info Emby ScripterX: onAuthenticationFailed: Anthony sadgasdfasdf "Chrome" 192.168.1.124

It will be available in the next release as %device.remote.ipaddress% :)

AnthonyMusgrove commented 4 years ago

It will also be available for onAuthenticationSucceeded !

AnthonyMusgrove commented 4 years ago

This is now available mate, and released into the catalog! See the token list under Authentication Succeeded & Failed. For more info: https://github.com/AnthonyMusgrove/Emby-ScripterX/blob/master/README.md