Reminders

Anonymous or Autologin to v15

21 months ago
OfflineM Gill
M Gill

I want users to be allowed to auto login from a link or anonymous login. We are using IIS 7 since going to v15 and enabled http on 82 and https on 11111 

In the FAQ I found "Automatically login to WhatsUp Gold by specifying username and password in URL" and I tried

https://nms:11111/NmConsole/DeviceManagement/DeviceList/DeviceList.asp?DeviceList.nDeviceGroupID=71?sUsername=guest&sPassword=guest

http://nms:82/NmConsole/DeviceManagement/DeviceList/DeviceList.asp?DeviceList.nDeviceGroupID=71?sUsername=guest&sPassword=guest

Neither work (they send me to login screen). Then I notice the FAQ article only covers version up to ver14.x Is this no longer supported in v15? Is there some other way to achieve the same results? Or am I overlooking something?

Thanks for your time,

Mike

-----
You liked this too2 people like this discussion.
 
Concluded

0 Conclusions:

10 Replies

OfflineJeremy McLeod Jeremy McLeod said 21 months ago

 The problem is that instead of the plain-text password in the query params, we require a string representation of the binary-encoded encrypted password.  Our DB guru has provided this query to easily figure out what that is.  If you run this query against your WhatsUp DB, you'll get the info you need.

 

DECLARE @StartVarBin VARBINARY(MAX)
SET @StartVarBin = (SELECT sPassword FROM dbo.WebUser WHERE sUserName = 'guest')


-- Parsing Variables
DECLARE @StartVarBinText VARCHAR(MAX)
DECLARE @CurrentLocation INT
DECLARE @List VARCHAR(MAX)
DECLARE @CurrentText VARCHAR(2)
DECLARE @CurrentHex VARBINARY(2)

-- Declare starting points
SET @StartVarBinText = (SELECT '0x' + CAST('' AS XML).value('xs:hexBinary(sql:variable("@StartVarBin") )', 'VARCHAR(MAX)'))
SET @CurrentLocation = 3
SET @List = ''

-- Cycle though digits
WHILE @CurrentLocation < LEN(@StartVarBinText)
BEGIN
SET @CurrentText = SUBSTRING(@StartVarBinText, @CurrentLocation, 2)
SET @CurrentHex = (SELECT CAST('' AS XML).value('xs:hexBinary( substring(sql:variable("@CurrentText"), 0) )', 'VARBINARY(MAX)'))
SET @List = @List + (CAST(CONVERT(INT, @CurrentHex) AS VARCHAR(10))) + ','
SET @CurrentLocation = @CurrentLocation + 2
END

-- Remove last comma
SET @List = LEFT(@List, LEN(@List) - 1)

-- Return results
SELECT @StartVarBin, @List

This will return a field that's a comma-separated string value of the password field. It will look something like 2,0,0,16,0,5,240,112,24,...,212 (none of those numbers will necessarily be there, it will just be a similar format).
You can then use that as the value for "sPassword" in your query and have auto-login work.

Your URL will then be something like http://nms:82/NmConsole/DeviceManagement/DeviceList/DeviceList.asp?DeviceList.nDeviceGroupID=71?sUsername=guest&sPassword=2,0,0,16,0,5,240,112,24,...,212


Be careful who you give those URLs out to, because they can just use that same sUserName and sPassword information to reach any page that user has access to.


OfflineJeremy McLeod Jeremy McLeod said 21 months ago

The line breaks in this forum make that fairly unreadable, but if you copy and paste the query into a text editor it should restore the proper line breaks.


OfflineM Gill M Gill said 20 months ago

Thanks for your response Jeremy. I followed these instructions, but still get challenged for login when I use that link. I tried IE and Firefox, same results.


OfflineGeorg Leitner Georg Leitner said 20 months ago

i can say, that the old autologin does work in 15.0.1. we have never changed the url since release 11 and it does still work with cleartext username and password.

/NmConsole/Workspace/HomeWorkspace/HomeWorkspace.asp?HomeWorkspace.nWorkspaceID=10010&sUsername=admin&sPassword=admin

OfflineM Gill M Gill said 20 months ago

Georg thanks for your post.

After you pointed this out, I did some testing and realized plain text autologin works when the landing page is one of the 'home' pages. I have been trying to use one of the 'devices' pages as a landing. I am not sure if this is a bug or by design.

I woudl still prefer this user to land in a devices group, but I can live with this; I created a custom 'home' page for him to land on.


OfflineJeremy McLeod Jeremy McLeod said 20 months ago

Does the user have rights to that group?  If the user doesn't have explicit group access rights (assuming group access rights are enabled) he'll be sent to the login screen anyway.  I know for sure that the autologin works as I described, as its usage is central to our PDF export functionality.


Would you like to comment?

You must be a member. Sign In if you are already a member.

  • 1,753 views
  • 1 version
  • 10 replies
  • 2 followers
     
Labels:

v15, WhatsUp Gold

Post Date:
August 31, 2011
Posted By:
M Gill

Related Content

Search this area

About this forum

  • 145k views
  • 2243 topics
  • 55 followers
     

Post questions and find answers for all things related to the Standard and Premium Editions of WhatsUp gold.


Viewed 1,753 times