How to authenticate a user by uid and password?

原文地址:Authentication
options
 | Basic
authorization

If you want to use simple binds with user DN and password within
a Java component, in order to authenticate users programatically, in
practice one problem arises: Most users do not know their DN.
Therefore they will not be able to enter it. And even if they know it, it
would be frequently very laborious due to the length of the DN.

It would be easier for a user if s/he only has to probvide a short,
unique ID and the password, like in this
web form:

Usually
the ID is an attribute within the user‘s entry. In our sample data (Seven
Seas), each user entry contains
the uid attribute, for instance
uid=hhornblo for Captain Hornblower:


dn: cn=Horatio Hornblower,ou=people,o=sevenSeas
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: top
cn: Horatio Hornblower
description: Capt. Horatio Hornblower, R.N
givenname: Horatio
sn: Hornblower
uid: hhornblo
mail: [email protected]
userpassword: {SHA}nU4eI71bcnBGqeO0t9tXvY1u5oQ=

But how to authenticate a user who provides "hhornblo"/"pass" instead
of "cn=Horatio Hornblower,ou=people,o=sevenSeas"/"pass" with the help of
ApacheDS?

An algorithm

In order to accomplish this task programmatically, one option is to
perform the following steps

Arguments


  • uid of a user (e.g. "hhornblo")

  • password proclaimed to be correct for the user

Steps


  • Bind to ApacheDS anonymously, or with the DN of a technical user. In
    both cases it must be possible to search the directory afterwards
    (authorization has to be configured that way)

  • Perform a search operation with an appropriate filter to find the
    user entry for the given ID, in our case
    "(&(objectClass=inetorgperson)(uid=hhornblo))"
    • If the search result is empty, the user does not exist --
      terminate

    • If the search result contains more than one entry, the given ID is
      not unique, this is likely a data error within your directory

  • Bind to ApacheDS with the DN of the entry found in the previous
    search, and the password provided as argument
    • If the bind operation fails, the password is wrong, and the result
      is false (not authenticated)

    • If the bind is successful, authenticate the user

How to authenticate a user by uid and password?,布布扣,bubuko.com

时间: 2024-09-30 07:42:15

How to authenticate a user by uid and password?的相关文章

关于spring-data-mongodb用户名密码登录报错问题:Failed to authenticate to database

一.问题 1.spring-data-mongodb用户名密码登录报错问题:Failed to authenticate to database  org.springframework.data.mongodb.CannotGetMongoDbConnectionException: Failed to authenticate to database [ashop], username = [ashop], password = [g***********4] org.springframe

openfire LDAP Guide

LDAP Guide ? Back to documentation index Introduction This document details how to configure your Openfire installation to use an external directory such as Open LDAP or Active Directory. Integration with a directory lets users authenticate using the

Aerospike系列:4:简单的增删改查aql

[[email protected] bin]# aql --help Usage: aql OPTIONS OPTIONS -h <host> The hostname to the server connect to. Default: 127.0.0.1 -p <port> The port number of the server to connect to. Default: 3000 -U <user name> User name used to auth

Aerospike系列:3:简单的增删改查aql

[[email protected] bin]# aql --help Usage: aql OPTIONS OPTIONS -h <host> The hostname to the server connect to. Default: 127.0.0.1 -p <port> The port number of the server to connect to. Default: 3000 -U <user name> User name used to auth

EF+mvc+mysql

这个真是一个大坑啊.TM折腾了一下午终于弄好了.赶紧记录下来分享给大家,免得有和我一样一直配置不成功的又折腾半天-.1.安装MySQL for Visual Studio这个直接在mysql官网下载并安装就好了.不过这个必须是vs2013 professional版本以上才可以!!2.安装MySQL Connector/Net这个可以可以通过NuGet工具获得,比较轻松愉快,当然你也可以自己下载,自己引用.3.配置web.config.首先是connectionStrings节点 1 <conn

用.net访问电子枢纽信用中心的数据查询服务

概要说明 电子枢纽全称国家交通运输物流公共信息平台,主要提供物流及生产企业进行物流相关数据交换的标准和API,详细介绍可参考其官网www.logink.org,本文假定阅读者对该平台已有了解,并已成功申请了相应的帐号和数据交换服务. 信用中心是电子枢纽众多数据服务中的一个,提供物流参与者信用信息的上传和查询,包括运输车辆.从业人员等.官方的示例和介绍大多以Java为主,.net的非常少,希望本文可以帮助.net开发人员快速掌握数据交换方式. 电子枢纽的数据服务分为两种,一种称为数据交换,另一种称

从HelloWorld启航——数据库连接字符串的困惑

程序员方阵 数据库连接字符串的困惑 数据库连接字符串的组成 驱动程序 ODBC OLE DB JDBC 比较 数据库链接字符串大全 SQL Server 2005 SQL Native Client ODBC Driver SQL Native Client OLE DB Provider SqlConnection NET MySQL MyODBC OLE DB OleDbConnection NET MySqlConnection NET Oracle ODBC OLE DB OleDbCo

修改shell 将当前shell(默认是bash B SHELL )改为csh C SHELL

在修改当前shell时,用命令: usermod -s  /bin/csh   home home 为 你所想要改变的用户地址     此处home 为家目录,一般自己创建的用户都会在家目录下生成用户名,亦可单独指定,如/home/idcdpi 当然修改shell亦可配置   /etc/passwd 如下: # vi /etc/passwd修改 /bin/bash 为 /bin/csh 将永久改变所有用户的shell  为C shell -----------------------------

面向对象编程思想-模板方法模式

一.引言 说到模板,顾名思义:就是样板,整体架构已经有了,你只需要填充自己的特定内容就可以了.如:简历模板,论文模板,PPT模板等 在软件设计中,模板方法模式与之很相似,下面请看我们今天要学习的模板方法模式 二.模板方法模式 定义:定义一个操作中的算法的骨架,而将一些步骤延迟到子类中.模板方法使得子类可以不改变一个算法的结构即可重定义该算法的某些特定步骤 下面结构图: 抽象模板角色(AbstractClass):在抽象类中定义一个或多个基本操作,每一个操作对应算法中一个步骤:同时提供一个模板方法