使用LDAP和hyperledger composer
我正在使用hyperledger composer为LDAP passport策略使用以下LDAP配置:使用LDAP和hyperledger composer,ldap,passport.js,hyperledger-composer,Ldap,Passport.js,Hyperledger Composer,我正在使用hyperledger composer为LDAP passport策略使用以下LDAP配置: export COMPOSER_PROVIDERS='{ "ldap": { "provider": "ldap", "authScheme": "ldap", "module": "passport-ldapauth", "authPath": "/auth/ldap", "callbackURL": "/a
export COMPOSER_PROVIDERS='{
"ldap": {
"provider": "ldap",
"authScheme": "ldap",
"module": "passport-ldapauth",
"authPath": "/auth/ldap",
"callbackURL": "/auth/ldap/callback",
"successRedirect": "/",
"failureRedirect": "/",
"server": {
"url": "ldap://localhost:389",
"bindDn": "cn=admin,dc=example, dc=com",
"bindCredentials": "*****",
"searchBase": "ou=admin,dc=example,dc=com",
"searchFilter": "(uid={{username}})"
}
}
}'
在github身份验证中,我们通常必须转到并登录github。现在在这种情况下,我应该在web url中给出什么,以便获得身份验证令牌。没有任何结果。那么,我是否需要在ldap、web url中传递现有用户名?如果是,那么URL应该是什么?我不认为您对passport ldapauth使用回调 所以 在哪里
- authScheme应设置为ldap模块应设置为 护照ldapauth
- authPath是身份验证的路径。即 前端将向/auth/ldap发送POST请求 由用户名和密码组成
- successRedirect是身份验证成功时重定向到的路径。但是,这被“json”覆盖:true李>
- “json”:true意味着环回将返回由令牌和用户ID组成的json响应,而不是重定向。这意味着这是由“其他东西”完成的,比如前端
- failureRedirect是身份验证失败时重定向到的路径
- 会话设置为false-将不使用会话
- profileAttributesFromLDAP—在profileAttributesFromLDAP部分中,如果需要,我们已将映射配置为获取:
- LDAP uid中的登录名、用户名和外部ID
- 来自LDAP的displayName的displayName
- 来自LDAP邮件的电子邮件 如果需要,请在此添加
- 登录名/用户名/邮件的ldap\u属性\u需要与 LDAP服务器等价物
- 服务器由具有LDAP服务器属性的对象组成
export COMPOSER_PROVIDERS='{
"provider": "ldap",
"authScheme":"ldap",
"module": "passport-ldapauth",
"authPath": "/auth/ldap",
"successRedirect": "/auth/account",
"failureRedirect": "/ldap",
"session": false,
"json": true,
"profileAttributesFromLDAP": {
"login": "uid",
"username": "uid",
"displayName": "displayName",
"email": "mail",
"externalId": "uid"
},
"ldap_attribute_for_login": "uid",
"ldap_attribute_for_username": "uid",
"ldap_attribute_for_mail": "mail",
"server":{
"url": "ldap://localhost:389",
"bindDn": "cn=admin,dc=example, dc=com",
"bindCredentials": "*****",
"searchBase": "ou=admin,dc=example,dc=com",
"searchAttributes": ["cn", "mail", "uid", "givenname"],
"searchFilter": "(uid={{username}})"
"url": "ldap://ldap.example.org:389/dc=example,dc=org",
"searchBase": "ou=people,dc=example,dc=org",
"searchFilter": "(uid={{username}})"
}
}'