Asene Lupin
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- title: Cấu hình OpenLDAP với WSO2IS 5.4.0 tags: WSO2IS description: Cấu hình WSO2 Identity server 5.4.0 sử dụng OpenLDAP làm primary userstore --- # How to configure Open LDAP with WSO2 Identity Server 5.4.0 - Hướng dẫn này sẽ giúp cấu hình một user-store (via OpenLdap) do bạn build thành primary user-store của wso2IS mà không cần dùng user-store mặc định của wso2. ## Thiết lập openLdap của bạn làm primary user-store - Bước 1: Cài đặt OpenLdap theo hướng dẫn tại đây: [Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-openldap-and-phpldapadmin-on-ubuntu-16-04) | [Windows](https://www.maxcrc.de/userbooster/) - Bước 2: Tải các file custome schema và add vào OpenLdap đã cài đặt ở bước 1 + [97-wso2Person.ldif](https://drive.google.com/file/d/1cVEZmuR2HzUStwhWG4nJ4nkTR2acbLwg/view?usp=sharing) + [98-scimPerson.ldif](https://drive.google.com/file/d/1iXk9MeWMEHYiopAVIm29v0tZ1-ziYObT/view?usp=sharing) + [99-identityPerson.ldif](https://drive.google.com/file/d/1Y9jvUanM2AP0kAoEIJr0aZhPOjMuNsoy/view?usp=sharing) - Bước 3: Add các file config đã download ở bước 2 vào OpenLdap đã cài đặt ở bước 1 ```ssh sudo ldapadd -Y EXTERNAL -H ldapi:// -f 97-wso2Person.ldif sudo ldapadd -Y EXTERNAL -H ldapi:// -f 98-scimPerson.ldif sudo ldapadd -Y EXTERNAL -H ldapi:// -f 99-identityPerson.ldif ``` - Bước 4: Khởi tạo 2 OU (Organization Unit) có tên là <b>"User"</b> và <b>"Groups"</b> trong Ldap - Bước 5: [Download](https://github.com/wso2/product-is/releases) phiên bản mới nhất của WSO2 Identity server và cài đặt - Bước 6: Ở chế độ mặc định, Wso2 identity server sẽ nhúng một LDAP là user-store mặc định. Để dùng OpenLdap bạn đã cài đặt trên server của mình thì cần phải sửa 02 file - <b><i>user-mgt.xml</i></b>(<i>[Carbon_home]/repository/conf</i>) - <b><i>tenant-mgt.xml</i></b> (<i>[Carbon_home]/repository/conf</i>) Nhớ đổi cn=admin,dc=wso2,dc=com tương ứng với các giá trị trên openLdap mà bạn đã cài đặt 1. <b><i>user-mgt.xml</i></b>(<i>[Carbon_home]/repository/conf</i>): ``` <UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager"> <Property name="TenantManager">org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager</Property> **<Property name="ConnectionURL">ldap://localhost:389</Property>** <Property name="ConnectionName">cn=admin,dc=wso2,dc=com</Property> <Property name="ConnectionPassword">root</Property> <Property name="AnonymousBind">false</Property> <Property name="UserSearchBase">ou=Users,dc=wso2,dc=com</Property> <Property name="UserEntryObjectClass">identityPerson</Property> <Property name="UserNameAttribute">uid</Property> <Property name="UserNameSearchFilter">(&amp;(objectClass=person)(uid=?))</Property> <Property name="UserNameListFilter">(objectClass=person)</Property> <Property name="DisplayNameAttribute"/> <Property name="ReadGroups">true</Property> <Property name="WriteGroups">true</Property> <Property name="GroupSearchBase">ou=Groups,dc=wso2,dc=com</Property> <Property name="GroupEntryObjectClass">groupOfNames</Property> <Property name="GroupNameAttribute">cn</Property> <Property name="GroupNameSearchFilter">(&amp;(objectClass=groupOfNames)(cn=?))</Property> <Property name="GroupNameListFilter">(objectClass=groupOfNames)</Property> <Property name="MembershipAttribute">member</Property> <Property name="BackLinksEnabled">false</Property> <Property name="UsernameJavaRegEx">[a-zA-Z0-9._\-|//]{3,30}$</Property> <Property name="UsernameJavaScriptRegEx">^[\S]{3,30}$</Property> <Property name="UsernameJavaRegExViolationErrorMsg">Username pattern policy violated</Property> <Property name="PasswordJavaRegEx">^[\S]{5,30}$</Property> <Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property> <Property name="PasswordJavaRegExViolationErrorMsg">Password length should be within 5 to 30 characters</Property> <Property name="RolenameJavaRegEx">[a-zA-Z0-9._\-|//]{3,30}$</Property> <Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property> <Property name="SCIMEnabled">true</Property> <Property name="IsBulkImportSupported">false</Property> <Property name="EmptyRolesAllowed">false</Property> <Property name="PasswordHashMethod">PLAIN_TEXT</Property> <Property name="MultiAttributeSeparator">,</Property> <Property name="MaxUserNameListLength">100</Property> <Property name="MaxRoleNameListLength">100</Property> <Property name="kdcEnabled">false</Property> <Property name="defaultRealmName">WSO2.ORG</Property> <Property name="UserRolesCacheEnabled">true</Property> <Property name="ConnectionPoolingEnabled">false</Property> <Property name="LDAPConnectionTimeout">5000</Property> <Property name="ReadTimeout"/> <Property name="RetryAttempts"/> </UserStoreManager> ``` 2. <b><i>tenant-mgt.xml</i></b> (<i>[Carbon_home]/repository/conf</i>): ``` <!--When the primary user store is using LDAP user store, in MT mode following tenant manager will be used.--> <TenantManager class="org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager"> <Property name="MultiTenantRealmConfigBuilder">org.wso2.carbon.user.core.config.multitenancy.CommonLDAPRealmConfigBuilder</Property> <Property name="RootPartition">dc=wso2,dc=com</Property> <Property name="OrganizationalObjectClass">organizationalUnit</Property> <Property name="OrganizationalAttribute">ou</Property> <Property name="OrganizationalSubContextObjectClass">organizationalUnit</Property> <Property name="OrganizationalSubContextAttribute">ou</Property> </TenantManager> ``` - Start WOS2IS, bạn sẽ thấy openLdap của bạn đã là primary data source. ## Configure cho phép add user thông qua Wso2 identity server console Tuy nhiên, khi bạn thử thêm một user bằng manager console của WSOIS thì bạn sẽ bị gặp lỗi sau: > Could not add user PRIMARY/asenelupin@gmail.com. Error: Cannot access the directory context or user already exists in the system for user :asenelupin@gmail.com Trong LDAP Console bạn có thể nhìn thấy Wso2 identity server đang cố gắng thêm user với một <b><i>ref-attribute</i></b>. Nguyên nhân gây ra lỗi trên là do <b><i>resourceType</i></b> mapped các thuộc tính của Ldap. Để khắc phục lỗi này chúng ta thực hiện như sau: - Bước 1: Login và Console manager của Wso2 identity server và vào <b>Home</b> -> <b>Indentity</b> -> <b>Claims</b> -> <b>List</b> - Bước 2: Chọn <b><i>"urn:ietf:params:scim:schemas:core:2.0"</i></b> và click <b>Edit</b> vào <b><i>"urn:ietf:params:scim:schemas:core:2.0:meta.resourceType"</i></b> - Bước 3: Ở ô nhập giá trị của <b><i>"Mapped Local Claim"</i></b> và thay đổi giá trị từ <b><i>http://wso2.org/claims/resourceType</i></b> thành <b><i>http://wso2.org/claims/userType</i></b> rồi click <b>Update</b> ![](https://i.imgur.com/2k5V3QT.png) - Bước 4: Sau khi thay đổi bạn đã có thể thêm được user vào openLdap của bạn thông quan Console manager của Wso2 identity server

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully