Flicks FAQ: Authxref


Back to the top of the FAQ

AuthentiX OCX Component

The AuthentiX OCX component automates access to and manipulation of the AuthentiX username/password database. The samples here have been checked against IIS and ASP.

The best way to get started with this OCX component is to install the remote admin asp application see how it works, search for the functions you need, and see how they are used.

File Names

AuthXOCX.ocx

The AuthentiX OCX component. For use with AuthentiX (Standard) or WebQuota. This component should be automatically registered for you on installation. Or type regsvr32 authxocx.ocx at the command line to register on your system.

AuthXISP.ocx

The AuthentiX ISP OCX component. For use with AuthentiX ISP or WebQuota ISP. This component should be automatically registered for you on installation. Or type regsvr32 authxisp.ocx at the command line to register on your system.

If you get
Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object

make sure AuthentiX is loaded on your machine and the component is registered.
Or, if you have installed AuthentiX ISP, then make sure you are using
Set auth = Server.CreateObject("AUTHXISP.AuthXOCXCtrl.1")
auth.SetVirtualDomain(Request.ServerVariables("LOCAL_ADDR"), Request.ServerVariables("SCRIPT_NAME"))

instead of
Set Auth = Server.CreateObject("AUTHXOCX.AuthXOCXCtrl.1")

Syntax

AuthentiX/WebQuota (Standard)
Set AuthX = Server.CreateObject("AUTHXOCX.AuthXOCXCtrl.1")
or
AuthentiX/WebQuota ISP
Set AuthX = Server.CreateObject("AUTHXISP.AuthXOCXCtrl.1")
' use this line to automatically set the domain to be the requesting IP
protectedDomain = Request.ServerVariables("LOCAL_ADDR")
' use this alternative if you are protecting by host header (version 4.5 and above)
' set protectedDomain to be -your- host header
' protectedDomain = "hostheader.com"
AuthX.SetVirtualDomain protectedDomain, Request.ServerVariables("SCRIPT_NAME")

' check with your isp for your password, initially it is empty (version 4.5 and above)
AuthX.SetVirtualDomainPassword("")

Note if the SetVirtualDomainPassword value is bad, then operations will return error # 14. Change it here to match the Password button in the Windows GUI.

Be sure to set Authx=nothing at the end of the file to avoid any possibility of memory leaks.

Here it is in text format for easy cut and paste.

Parameters

AuthX
Specifies the name of the object created by the call to Server.CreateObject.

Registry Entries

None.

Properties

UserPassword

Gets or sets a specified user's password.

UserNotes

Gets or sets a specified user's notes.

UserExpiration

Gets or sets a specified user's Expiration date.

Methods

CurrentUserName

Gets the username of the currently authenticated user.

UserLookup

Checks to see if the user exists.

UserAdd

Adds a user.

UserDelete

Deletes a user.

UserModify

Modifies a user.

UserGroups

Tells which groups a user is in.

GroupAddUser

Adds an existing user to an existing group.

GroupHasUser

Checks to see if the user is a member of the group.

GroupDeleteUser

Deletes the user from a group.

GroupAddNewUser

Adds an new user to an existing group.

Flush

Commits changes made.

ReRead(UDC, "", "")

Forces a reload of the internal database from the .adb file for that UDC (unique descriptive name).

Additional Methods for Cookie-based Protection

CookieLoginCookieName

Returns the name of the initial cookie.

CookieLoginValue

Returns the initial cookie value.

CookieCurrentUserName

Gets the username of the current user when using Cookie-based protection.

Alternative Methods for Cookie-based Protection

CookieSWValue

Simpler alternative with Site-Wide cookies.

GetCrypt

Assistant function used when using CookieSWValue with Advanced ODBC, or By COM

Miscellaneous Methods

SMTPSendMail

Sends an email message.

GetAuthxVersion

Returns a version string.

EventLog(source, message)

Puts the message in the event log, indicating the source, (version 5.2e1 and above).

EncodeViaDLL

Encodes a string (password) using a dll.

AuthentiX ISP Specific Methods

SetVirtualDomain

Specify which virtual domain subsequent operations apply to.

SetVirtualDomainDirect

Specify which virtual domain subsequent operations apply to.

ODBC Specific Methods

ODBCRemoveUserFromCache

Remove a user from the 10 minute ODBC username cache. Example:
result = ODBCRemoveUserFromCache("user1")

WebQuota CMCL Edition Specific Methods

GetConcurrencyToken

Get a concurrency token or "ticket" that uniquely identifies the browser.
cookieValue = cookieValue + auth.GetConcurrencyToken(2, Request.Cookies(cookieName))

ClearConcurrencyToken

Clear the concurrency token and reset the internal concurrency token cache of for this token.
ccresult = auth.ClearConcurrencyToken(2, protectedAbsPath, Request.Cookies(cookieName))

Example: ASP and Cold Fusion

The following example gets the details of a user.

<% 
usingAuthentiXStandard = true
if (usingAuthentiXStandard) then
Set AuthX = Server.CreateObject("AUTHXOCX.AuthXOCXCtrl.1") 
else
Set AuthX = Server.CreateObject("AUTHXISP.AuthXOCXCtrl.1") 
protectedDomain = Request.ServerVariables("LOCAL_ADDR")
'protectedDomain = "hostheader.com"
AuthX.SetVirtualDomain protectedDomain, Request.ServerVariables("SCRIPT_NAME")
AuthX.SetVirtualDomainPassword("")
end if
%>

<%= Auth.GetAuthxVersion %>
<% result = auth.UserLookup("Brian") %>
<% If result = 0 Then %> Brian is there.
His password is <%= Auth.UserPassword("Brian") %>
His expiration date is <%= Auth.UserExpiration("Brian") %>
User notes for this user are:
<%= Auth.UserNotes("Brian") %> <% Else %> Brian is nowhere to be found. <% End If %>

Result of lookup is: <%= result %>

The following is a snippet of Cold Fusion to get the currently logged in user name:
<cfobject action="create"
	name="auth_x"
	class="authxocx.authxocxctrl.1">
	
 <cfset user=auth_x.currentusername(#server_name#,#script_name#,#http_authorization#)> 

and here is another for cookie-based login:

<cfset protectedAbsPath = "d:\websites\members\">
<cfset cookieName = AuthX.CookieLoginCookieName(protectedAbsPath, "")>
<cfset CFCookie = evaluate("cookie."&cookieName)>
<cfset ClientUsername = AuthX.CookieCurrentUserName(CFCookie)>

Using with .Net/ASPX

The GUID for authxocx is 2c3a2917-e7fa-11d0-bc0f-02608CAD9C7D

So

< Reference
Name = "authxocxLib"
Guid = "{2c3a2917-e7fa-11d0-bc0f-02608CAD9C7D}"
VersionMajor = "1"
VersionMinor = "0"
Lcid = "0"
WrapperTool = "tlbimp"
/>

then use the authxocxLib.authxocxClass

The GUID for AuthXISP is 2f426b11-094d-11d1-bc1e-02608cad9c7d

So

< Reference
Name = "authxISPLib"
Guid = "{2f426b11-094d-11d1-bc1e-02608cad9c7d}"
VersionMajor = "1"
VersionMinor = "0"
Lcid = "0"
WrapperTool = "tlbimp"
/>

then use the authxISPLib.authxISPClass
http://www.flicks.com/authentix/discover/main.htm

Back to the top of the FAQ