How to authenticate from an ASP site, not ASP.NET, get user ID using MembershipWebService

I had a customer today that asked the question below. Also figure to have another one shortly. So I am seeking guidance on how to approach the need to authenticate with the membership web service and get an iMIS ID. It is not clear how or if you get a cookie that can be read, or can return the ID. I know that getting an ID was not available in the membership web service in previous versions.

Please post suggestions on how to approach.

This is her question:

 I now need to generate a list of conference participants on our www.xyz.org site (an ASP site)

This list is of course only accessible to conference participants.

So before giving someone access they need to know how to check in IMIS15 if a person is registered for the conference.

I know you sent me the link to the XML and ive researched the SOAP method but i don’t know how to apply that to our site.

Can you please convert the steps below to what I should be in the current situation?

 

 

 

Last year I made a form  with this:

 

<form action="http://members.eaie.nl/source/Security/MemberLogonValidate.cfm?section=unknown&forwardto=http://members.eaie.nl/membersonly/participants2.asp" method="POST" name="security">

I would get back their IMIS_ID in a ESERIES cookie, then I would perform a select query:

 

SQL = "SELECT Order_Badge.Informal, Orders.ST_ID, Order_Badge.Last_Name, Order_Badge.Full_Name FROM Order_Badge, Orders, Order_Meet WHERE Order_Badge.ORDER_NUMBER=Orders.ORDER_NUMBER AND Order_Meet.ORDER_NUMBER=Orders.ORDER_NUMBER and Order_Meet.MEETING='NANTES10' and Orders.STATUS='' and Order_Meet.UF_1 = 0 and Order_Meet.REGISTRANT_CLASS in ('M','NM','SP','SPO','STU', 'RED', 'STAFF', 'PR', 'SPM', 'SPNM', 'STUM', 'STUNM', 'DP01', 'DP02', 'DP03', 'DP04', 'EXHM', 'EXHNM', 'EXWM', 'EXWNM') AND Orders.ST_ID="&cookie&""

 

And give them access or not.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

You *can* get there from here

MWS may not return the varchar(10) iMIS ID, but if it returns any key at all, you should be able get there.

If you get a GUID, that will either be the ProviderKey or UserKey from UserMain.  (I forget which one - could be both with different methods.)  From there you can get the iMIS ID easily and use it to grab the data.  The example below assumes UserMain.ProviderKey.  (Converted to ANSI joins at no extra charge.)

SQL = "SELECT Order_Badge.Informal, Orders.ST_ID, Order_Badge.Last_Name, Order_Badge.Full_Name
FROM Order_Badge
join Orders on Orders.ORDER_NUMBER = Order_Badge.ORDER_NUMBER
join Order_Meet
on Order_Meet.ORDER_NUMBER = Orders.ORDER_NUMBER
join UserMain on UserMain.ContactMaster = Orders.ST_ID
where Order_Meet.MEETING = 'NANTES10'
and Orders.STATUS = ''
and Order_Meet.UF_1 = 0
and Order_Meet.REGISTRANT_CLASS in ('M','NM','SP','SPO','STU', 'RED', 'STAFF', 'PR', 'SPM', 'SPNM', 'STUM', 'STUNM', 'DP01', 'DP02', 'DP03', 'DP04', 'EXHM', 'EXHNM', 'EXWM', 'EXWNM')
and UserMain.ProviderKey = '" & KeyReceivedFromMWS & "'"

 

--
Bruce Wilson
Director, Technical Services
RSM McGladrey, Inc.

This how we authenticate

This how we authenticate classic ASP with iMIS Web Services.

The complete page is here.

http://www.imiscommunity.com/classic_asp_consuming_imis_membership_webservice_0

 

Snip of code here.

'Define body of SOAP with method name and parameter names and vlaues to be passed.
strEnvelope = strEnvelope & "<soap:Body>"
strEnvelope = strEnvelope & "<LoginUser xmlns='http://imis.com/webservices/membership'>"
strEnvelope = strEnvelope & " <username>" & username_str & "</username>"
strEnvelope = strEnvelope & "<password>" & password_str & "</password>"
strEnvelope = strEnvelope & "<staffUser>false</staffUser>"
strEnvelope = strEnvelope & "</LoginUser>"
strEnvelope = strEnvelope & "</soap:Body></soap:Envelope>"
   
'Set properties of HTTP object and send SOAP envelop while calling  method
Dim url
url = "http://webconfigURLKey/iMIS15/AsiCommon/Services/Membership/MembershipWebService.asmx?op=LoginUser"
With objHTTP   
    .Open "post", url, False   
    .setRequestHeader "Content-Type", "text/xml; charset=utf-8"   
    .setRequestHeader "SOAPAction", "http://imis.com/webservices/membership/LoginUser"   
    .send strEnvelope
End With

Bruce M Walker

BSCI

Chicago IL

The version of iMIS will determine SQL to convert UID to iMIS ID

The version of iMIS will determine SQL to convert UID to iMIS ID.

Previously there has not been a method from the webservice to return the iMIS ID.

Bruce M Walker

BSCI

Chicago IL

A more obvious way

If you have already determined that the user can log in using one of the MWS services, then you know the login they provided is valid and unique.  That would correspond with UserMain.UserId.

If you no longer know the user is logged in, you could call GetUserForAuthenticatedUser.  This will return both the login and the ProviderUserKey, either of which will serve the purpose.
--
Bruce Wilson
Director, Technical Services
RSM McGladrey, Inc.