locked
QUERY in the code provided RRS feed

  • Question

  • Hi Tao Zhou

    you have provided below code for checking if windows AD group user is searching is present or not. 

     Can we add one more step in code that person is entering his id only . for ex only one member of my team has access but we can enter his id and wrong person will be logged in . 

    we are using this for login page and windows AD authentication is used. sequence is first login page appear -then user enters his windows id -from all AD group the code will check if user is present in required AD group if yes -logged in-next userform to update database value will be opened .

    As database is involved this is quite critical.

    I think we are missing to add one more check /validation in this code so that user is entering his id only because we are not asking any password here.


    cheryl_ 123


    • Edited by Megh_ 123 Friday, January 5, 2018 10:58 AM
    Friday, January 5, 2018 10:28 AM

Answers

  • Hi Megh_123,

    >>If A has only access and B tries to access from B's computer with A's username of windows Then would B be able to login?

    If so, there is no need to provide textbox to fill A's username. You could try code below to get the username of the computer.

    Function GetCurrentUser() As String
        GetCurrentUser = Environ("USERNAME")
    End Function

    Then, check whether the result for GetCurrentUser will be A or B while logging.

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Megh_ 123 Monday, January 8, 2018 9:36 AM
    Monday, January 8, 2018 7:58 AM

All replies

  • Hi Megh_123,

    >> for ex only one member of my team has access but we can enter his id and wrong person will be logged in

    Do you mean if only A could login, B could not login in by A account? If so, how could I retrieve whether Person A or B enter A string?

    In my option, we could not limit what will the end user enter.

    Will A login only on his computer? If A will login by B’s Computer, I am afraid it is impossible.

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 8, 2018 7:40 AM
  • yes , because we are not verifying password anywhere. If A has only access and B tries to access from B's computer with A's username of windows Then would B be able to login?

    cheryl_ 123

    Monday, January 8, 2018 7:52 AM
  • Hi Megh_123,

    >>If A has only access and B tries to access from B's computer with A's username of windows Then would B be able to login?

    If so, there is no need to provide textbox to fill A's username. You could try code below to get the username of the computer.

    Function GetCurrentUser() As String
        GetCurrentUser = Environ("USERNAME")
    End Function

    Then, check whether the result for GetCurrentUser will be A or B while logging.

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Megh_ 123 Monday, January 8, 2018 9:36 AM
    Monday, January 8, 2018 7:58 AM
  • Thanks Tao Zhou for your guidance throughout. It helped a lot.

    cheryl_ 123

    Monday, January 8, 2018 9:36 AM