I'm using the attached code for user authentication.
Users have two different options to log in.
When they log in with their EMP_ID the logon format is someting like USA\U123456, or EUROPE\U 123456, or ASIA\U123456
The EMP_ID part from the logon is 123456. This is what I capture, and it's working fine.
The problem is when they log in with their ALT_ID
In this case the logon format is something like USA\ABC12, or EUROPE\RTX24T, or ASIA\G678PFGH
This is when I can't capture their EMP_ID, LAST_NAME, or FIRST_NAME.
How can the code below be changed to be able to capture their identity with any of their logon options.
Thank you for your help.
set rs = Server.CreateObject("ADODB.recordset")
UserID = Request.ServerVariables("LOGON_USER")
UserID = Replace(UCase(UserID), "\U", "\")
UserID = Mid(UserID,instr(UserID,"\")+1)
rs.Open "exec sp_Authentication'" & UserID & "'", Conn
do until rs.EOF
EMP_ID = rs("EMP_ID")
ALT_ID = rs("ALT_ID")
FIRST_NAME = rs("FIRST_NAME")
LAST_NAME = rs("LAST_NAME")
Set rs = Nothing