How to use a bearer token for authentication using Python SDK
I am trying to use a bearer token for authentication using Python SDK. On the documentation I found several examples using the LMv1 access_id and access_key values, like this: # Configure API key authorization: LMv1 configuration = logicmonitor_sdk.Configuration() configuration.company = 'YOUR_COMPANY' configuration.access_id = 'YOUR_ACCESS_ID' configuration.access_key = 'YOUR_ACCESS_KEY' # create an instance of the API class api_instance = logicmonitor_sdk.LMApi(logicmonitor_sdk.ApiClient(configuration)) but couldn’t find any example on using bearer token for authentication. After some search I found something about defining “api_token” and “api_token_prefix” but couldn’t get it to work. Anybody have any example I could follow to use this?417Views17likes21CommentsUnable to authenticate Rest api with servicenow to get devices
Hi All, I am trying to authenticate in servicenow using script but it is not working. It is throwing an error authentication failed status 401. var ACCESS_ID = '123'; var ACCESS_KEY = 'abc'; var ACCOUNT_NAME = 'test'; var resourcePath = '/device/devices'; var epoch = (new Date()).getTime(); var id = 2; var requestVars = 'GET' + epoch + resourcePath; var HexUtil = { convertByteArrayToHex : function(byteArray) { var hex = ""; byteArray.forEach(function(byteValue) { hex += HexUtil.convertByteToHex(byteValue); }); return hex; }, convertByteToHex : function(b) { var hexChar = ["0", "1", "2", "3", "4", "5", "6", "7","8", "9", "a", "b", "c", "d", "e", "f"]; return hexChar[(b >> 4) & 0x0f] + hexChar[b & 0x0f]; } }; // Compute the HMACSHA256 hash using GlideDigest var key = "key"; key = encodeURIComponent(key); key = GlideStringUtil.base64Encode(key); var msg = "message"; msg = encodeURIComponent(msg); var mac = new GlideCertificateEncryption(); signature = mac.generateMac(requestVars, "HmacSHA256", ACCESS_ID); var bytes = GlideStringUtil.base64DecodeAsBytes(signature); var hex = HexUtil.convertByteArrayToHex(bytes); var hexB64 = GlideStringUtil.base64Encode(hex); var token = 'LMv1 ' + ACCESS_ID + ':' + signature + ':' + epoch; gs.info('Devices = ' +token); var httpRequest = new GlideHTTPRequest('https://' + ACCOUNT_NAME + '.logicmonitor.com/santaba/rest/device/devices'); httpRequest.addHeader('Content-Type', 'application/json'); httpRequest.addHeader('Authorization', token); //httpRequest.addHeader('x-server-version', '3'); var response = httpRequest.getBody(); gs.log(response); Could you please help me on this.320Views4likes3CommentsAdditional Multi-Factor Authentication Providers
Whilst LogicMonitor support two-factor authentication (https://www.logicmonitor.com/support/settings/users-and-roles/two-factor-authentication/), beyond phone call and SMS options, it appears be limited to Authy as a provider. Whilst they're a perfectly good vendor, it would be useful if it were possible to configure Multi-Factor Authentication across a variety of providers. Of most interest to me right now is Azure MFA. Is this something that is available already (though undocumented)? If not is this something that could be factored into the release cycle? Many Thanks ~Nick8Views2likes0Comments2FA - generic MFA application support
Currently 2FA supports text message, and you can create an Authy account after enabling 2FA in LM. But if you already have an MFA account (Authy, Google Authenticator or otherwise) there is no way to add LM into your existing application. A QR code or numeric code to add to a third party MFA device would be useful. Thanks4Views0likes1CommentMulti Domain Web Services steps?
I am trying to monitor our website and validate a test account can log in successfully. The site uses Form Based authentication (not Basic or NTLM). So I need to somehow POST the login credentials to another webservice and have the info sent back. Problem is the authentication web service page is on a different URL domain. Step 1: Navigate to http//:www.abc.com and validate splash page Step 2: "Get /login.aspx" (takes me to http://www.abc.com/login.aspx) Step 3: POST User/Pass & *probably* cookie session info from Step 2to https://idt.abc.com/authenticate Step 4: Get the "login successfully" response from idt.abc.comand validate page Seems once i create a Web Servicecan only define 1 domain (i.e. www.abc.com), so I have not way to make the secondary call to the webservice to authenticate that login..at the different domain idt.abc.com Any way to do this with LogiMonitor Services? Thanks5Views0likes0Comments