I am writing a web service for my department at work. I write backend on java using jetty, servlet.

There is an authorization code in Active Directory and user search by keyword - username. The code works, finds information about this user.

But I need to do the following. A remote user on the corporate network, logged in when logging into his computer, logged into the web service and made some changes to it, and the server gets its name.

Connection to the server is remote.

  • No, using AD you will not get a username. With it, you can make authentication and use authorization. And you can get the name only on jetty, if of course you screwed some authentication to your web service - Sergey

1 answer 1

When logging in, the system gets the user ID. The user must log in to the portal to use his services. So there is an ID on the portal. Access to the portal is only from the corporate network? If so, then we have the ID of the logged in user + ID-portal user, but so far there is no correspondence between these IDs for the entire set of users. If for the login on the portal just a keyword is used (the username of the user on the portal), then we simply use the search code for that keyword and that's it. We take the username from the AD by keyword, while checking that such user is currently active in the AD network. If the ID is active both in AD and on the portal, everything is OK. If the ID is active only on the portal, and did not enter the AD, we do not give it access to the portal.