Alpha Video Training
Results 1 to 4 of 4

Thread: Assigning Active Directory User Info to Variables: Cannot Get a5ws_getUserValuesActiveDirectory Function to Work

  1. #1
    Member
    Real Name
    Tarek El Mohamad
    Join Date
    Aug 2013
    Posts
    3

    Default Assigning Active Directory User Info to Variables: Cannot Get a5ws_getUserValuesActiveDirectory Function to Work

    I'm working to update an existing web application from using native security to using Active Directory for authentication. I am simultaneously updating said application from using the Alpha Anywhere Application Server to using IIS. I am using the integrated AD configuration, and this part is working well, as is the IIS Application Server. However, my application relies on session variables that populate from user tables that I am attempting to mimic using the a5ws_getUserValuesActiveDirectory function.

    Unfortunately, I cannot get the a5ws_getUserValuesActiveDirectory function to work in any way, shape or form. For testing purposes, I am attempting to run the following in the A5W page that contains a web component:
    Code:
    <%a5
    dim user as p
    dim displayname as c
    'user = a5ws_getuservaluesactivedirectory(Context.Security.CurrentUser)
    'user = a5ws_getuservaluesactivedirectory("")
    user = a5ws_getuservaluesactivedirectory("HardCodedUsername")
    if variable_exists("user.SamAccountName")
    	? "yep"
    	displayname = user.DisplayName
    	? displayname
    else
    	? "nope"
    end if
    %>
    No matter what I pass into this function, I cannot populate nor successfully test for any variable that I try. Context.Security.CurrentUser correctly retrieves the currently logged in user. Is there something else that needs to be configured in order for this function to work?

  2. #2
    "Certified" Alphaholic CharlesParker's Avatar
    Real Name
    Charles Parker
    Join Date
    Dec 2012
    Location
    New Orleans, LA
    Posts
    2,115

    Default Re: Assigning Active Directory User Info to Variables: Cannot Get a5ws_getUserValuesActiveDirectory Function to Work

    The first thing I would do is get rid of the IF statement and put a debug statement in, once you get to user = a5ws_getuservaluesactivedirectory("loggedinuser/username") you should see the pointer variable fill up with data especially if your explicitly setting the username - that is of course if the function is working properly.
    I am assuming you read the documentation at https://documentation.alphasoftware....20Function.xml
    NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

  3. #3
    Member
    Real Name
    Tarek El Mohamad
    Join Date
    Aug 2013
    Posts
    3

    Default Re: Assigning Active Directory User Info to Variables: Cannot Get a5ws_getUserValuesActiveDirectory Function to Work

    Thank you for your response, Charles! Yes, I've read the documentation several times now, and I don't believe I'm doing anything that deviates from intended usage.

    I placed this simple code alone in a new, otherwise empty A5W page and set this up in the xbasic debugger, where I can see that the function successfully retrieves and assigns the desired variables, when run in Live Preview. If I then publish this to the Alpha Anywhere Application Server, it runs perfectly. However, if I then publish this same page to the IIS Application Server, it does not function properly.

    This suggests to me that this function either doesn't work with the IIS Application Server, or I'm missing something in how IIS needs to be set up to support this. IIS is already set up for Active Directory (integrated) authentication, and this functionality is working fine.

  4. #4
    Member
    Real Name
    Tarek El Mohamad
    Join Date
    Aug 2013
    Posts
    3

    Default Re: Assigning Active Directory User Info to Variables: Cannot Get a5ws_getUserValuesActiveDirectory Function to Work

    Thanks for the response, Charles! Yes, I have read the documentation at that link several times.

    If I create a new, otherwise empty A5W page with only this simple code with applicable debug statements, and walk it through Live Preview and the Xbasic Debugger, I see the function execute properly, retrieve the applicable values and successfully assign them to the variables. If I then publish this page to the Alpha Anywhere Application Server, it functions exactly as I expect it to.

    If I then take this same page and publish it to the IIS Application Server, the function doesn't retrieve the desired values. The only conclusions I can draw are that this function either doesn't work with IIS, or that there is something I don't have set up on the IIS side that is needed to allow this to work. However, I do have IIS set up to use Active Directory (integrated) for authentication, and this has otherwise been working fine.

Similar Threads

  1. How to get Active Directory user details
    By leemillard in forum Tablet-Optimized Form Capabilities Beta
    Replies: 4
    Last Post: 09-14-2017, 03:17 AM
  2. How to Access Active Directory user details i.e. telephone, firstname,lastname
    By leemillard in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 09-05-2017, 10:32 AM
  3. Getting Active Directory integration to work
    By Scot@FNC in forum Mobile & Browser Applications
    Replies: 6
    Last Post: 10-27-2014, 02:46 PM
  4. Lockout user while connected to Active Directory
    By Skeith in forum Mobile & Browser Applications
    Replies: 9
    Last Post: 10-09-2014, 02:29 PM
  5. assigning info to 3 child tables
    By DaveM in forum Alpha Five Version 4
    Replies: 11
    Last Post: 10-10-2001, 07:26 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •