3 Replies - 748 Views - Last Post: 20 March 2013 - 10:22 PM

#1 rbflowers  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 48
  • Joined: 10-February 12

Internal website, get login or username. Connect to LDAP?

Posted 20 March 2013 - 06:43 PM

hi, not sure if I can do this in javascript or jquery, but hopefully someone can point me in the right direction.

I have site that can only be accessed on the company's internal network, but certain areas of the site shouldn't be viewed by everyone. So, I'd like to be able to write a script that pulls the ID or name or some special value of the visitor and:
If (s)he are in the special list, return the whole site.
If (s)he is not in the list, return another site.

I'm almost positive my company uses LDAP - is there anyway javascript can connect to LDAP?

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Internal website, get login or username. Connect to LDAP?

#2 no2pencil  Icon User is online

  • Dic Head
  • member icon

Reputation: 5165
  • View blog
  • Posts: 26,841
  • Joined: 10-May 07

Re: Internal website, get login or username. Connect to LDAP?

Posted 20 March 2013 - 07:25 PM

Javascript is executed by the browser. I don't know what an LDAP is, but it would need to be on every machine that accessed the site.

If an LDAP is something centralized, like say a database, then you need to understand server-side/client-side processing. Javascript would not be the tool for this, imo.
Was This Post Helpful? 1
  • +
  • -

#3 Takk  Icon User is offline

  • D.I.C Head

Reputation: 40
  • View blog
  • Posts: 111
  • Joined: 08-March 13

Re: Internal website, get login or username. Connect to LDAP?

Posted 20 March 2013 - 07:36 PM

As far as my LDAP understanding goes (limited), you're missing a few pieces to the puzzle here.. Javascript is meant to create a sort of interactivity to the webpage that it is being viewed on, therefore alone, has no access to any files stored on the server (in a way that would make it valid for user verification in any type of secure environment).

However if you've got a webserver that youre building on top of, PHP or ASP would be a viable middle man to contact LDAP services and be as fine a choice for authentication as any.

The short answer is no, javascript wont be able to access a site outside of it's own domain, it can request 'myfile' from the same server it's running from through an httprequest object, but any reading or manipulation of it is generally completely public and with given browser tools javascript can be changed from the browser and then run the same as if it were coded by you.

If you have access to a server side scripting language though, you could use it to verify the user, save the session state to authenticated and then have the script act as an intermediary to the LDAP server through sockets or however it necessary at that point, given the user had properly authenticated.
Was This Post Helpful? 1
  • +
  • -

#4 rbflowers  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 48
  • Joined: 10-February 12

Re: Internal website, get login or username. Connect to LDAP?

Posted 20 March 2013 - 10:22 PM

I'm building the site in mvc3, but don't know much c# so was hoping there was a js solution. I found some articles online on how to connect to ldap using c# so will try that and if I have any questions will post in the appropriate pages.

Thanks for the responses.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1