dongli1887 2018-03-22 16:04
浏览 248

PHP - LDAP - 获取用户组GUID,而不是名称

I am in the process of building a website for a company I work for. I would like to run some of it off the LDAP server that's already in use. Right now I have it linked for logging in and out, not much of an issue.

My next step, which has seemed to become more of a delay, is user groups and permissions. I would like to be able to get the groups a user is member of. Normally, this will just return the full string of the group, but I would prefer to have the GUID.

I know I can take the strings and query the server, then obtain the group GUID. This just seems to be more processing for the server.

I'd like to have this for logging in the database. If the name changes, the list of users don't. It would cause too many issues and store too much in the database if I went based off the full string rather than the GUID.

My other idea/option would be to search and cache all the GUIDs in a table, updating the names if they change. This way I'm not querying the LDAP server a munch for what I need, and can manage it all inside the same server. The servers are in the same network, but it's always fastest when running locally.

TL;DR Is there a way I can query the LDAP server and get the list of groups a user is in, returning the group GUID rather than its full name.

I'm still new to working with LDAP too, in case I'm missing anything.

  • 写回答

1条回答 默认 最新

  • dongliufa6380 2018-03-28 14:09
    关注

    I think it's overkill to make a local replication, openldap can carry out 22,000 queries / second or 4,800 update / second and can contain up to 150 million entries (Year 2006 benchmark).

    It's the job of the LDAP to do this, and it does it generally well. Your local replication just involve latency when there is a user/group change, can be source of errors, while it does not bring significant improve.

    评论

报告相同问题?

悬赏问题

  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)