Tagged: 

This topic contains 10 replies, has 4 voices, and was last updated by  raje@gworks.mobi 6 months ago.

  • Author
    Posts
  • #4557
     vuvandung861011@gmail.com 
    Participant

    Hi all,
    Currently I am working with openaM, I am having difficulty in linking between openAM and mysql.
    I want to sign in with openAM by user in table database mysql
    and when register on openAM the user’s information is added in the User table mysql.
    Please help me.
    Thank

    #4561
     vuvandung861011@gmail.com 
    Participant

    K.satou help
    I refer to this Japanese site. http://memoyasu.blogspot.jp/2012/11/openam100-mysql.html

    1. Start the MySQL Command Line Client, create the database for the user.

    mysql> create database user_db;
    2. Create the user “db_user” to access the database for the user.

    mysql> grant select,insert,delete,update,create,drop,file,
    -> alter,index on *.* to db_user identified by ‘password’;
    3. Create the table “auth_users” for storing user information to user_db database.

    mysql> use user_db;
    Database changed
    mysql> create table auth_users(uid varchar(50),cn varchar(50),inetuserstatus va
    rchar(20),userpassword varchar(50),ChangePassword varchar(50),mail varchar(50),s
    unIdentityMSISDNNumber varchar(50),sn varchar(50),manager varchar(50),preferredl
    ocale varchar(10),iplanet_am_user_password_reset_force_reset varchar(50),givenna
    me varchar(50),iplanet_am_user_alias_list varchar(50),iplanet_am_user_account_li
    fe varchar(50),telephonenumber varchar(50),employeenumber varchar(50),iplanet_am
    _user_auth_config varchar(50),postaladdress varchar(50),iplanet_am_user_password
    _resetoptions varchar(50),iplanet_am_user_password_reset_question_answer varchar
    (50),iplanet_am_user_success_url varchar(50),iplanet_am_user_failure_url varchar
    (50));
    4. Copy the MySQL connector “mysql-connector-java-5.1.22-bin.jar” to the following directory OpenAM deployed. or set to class path.

    D:\glassfish\domains\domain1\applications\j2ee-modules\opensso\WEB-INF\lib
    5. Restart the Glassfish.

    6. Login to OpenAM Management Console.

    7. “Access Control” -> “/(Top level realm)”->”Datastore”

    8. Press the “New” button. In “Step 1/2 Select the type of data store”, you set the following. After setting, you press the “Next”.

    Name: any data
    Type: database repository(Early Access)
    9. In “Step 2/2 the new data store in a database repository(Early Access)”, perform the MySQL settings. After setting you press the “End”.

    ・Password to connect to the database: ***
    ・JDBC driver URL: jdbc:mysql:127.0.0.1:3306/user_db
    ・User to connect to the database: db_user
    ・User table name of the database : auth_users
    10. In the “data store” tab, delete existing “embedded” the OpenDJ.

    11. “Subject”->”User” tab, press “New” button to create a user. Normally to ensure that the user is created.

    #4562
     Rogerio Rondini 
    Participant

    Hi..

    So, Would be useful you take a look at the OpenAM debug files. You can check in the files Configuration, Authentication, IdRepo, etcc… and post here.

    At.
    Rogerio Rondini

    #4564
     vuvandung861011@gmail.com 
    Participant

    hi Rogerio Rondini
    Thank for your help .
    Dung

    #4574
     ltta1505 
    Participant

    Hi Dung,

    Could you please help me to check if the steps above work correctly or not? I’m also finding a way to link OpenAM with existent MySQL database. I’m really grateful if you help me this.

    Thanks

    #4575
     vuvandung861011@gmail.com 
    Participant

    hi ltta1505
    I’ve tried, and successfully connected
    Thanks
    Dung

    #4577
     ltta1505 
    Participant

    Hi Dung,

    I’m still confused from step 4th. Do you have any documents or tutorials which help to clarify these steps? Thanks in advance!

    #4578
     ltta1505 
    Participant

    Hi Dung,

    One more thing: could you please give me tutorials which hep to setup a OpenAM sample project working with MySQL database (for Authentication and Authorization purpose)?

    Thanks!

    #4580
     vuvandung861011@gmail.com 
    Participant

    hi ltta1505
    you can connect openam and mysql with step by step 1..11
    if you can help , you add skype : bboypukiu
    i hope help you
    .
    i have connected success mysql with openam , and i can login if user in mysql table
    and create user in openam admin console
    but i don’t create user from link register of openam , i try fix its

    #14726
     raje@gworks.mobi 
    Participant

    Hello vuvandung861011@gmail.com,

    i have configured, as per you suggestion, after remove In the “data store” tab, delete existing “embedded” the OpenDJ.

    I open openam(13.0) console click subject its throw exception, AMUncaughtException

    url ==> openam.test.mobi:8080/openam/base/AMUncaughtException

    error mag ==> An error occurred while processing this request. Contact your administrator.

    what i did:

    1. create database,
    2. grant privillage,
    3. create table,
    4. copy mysql-connect.jar to /tomcat/webapps/openam/WEB-INF/lib,
    5. restart the tomcat
    6. Login to OpenAM Management Console.

    7. “Access Control” -> “/(Top level realm)”->”Datastore”

    8. Press the “New” button. In “Step 1/2 Select the type of data store”, you set the following. After setting, you press the “Next”.

    Name: mysql
    Type: database repository(Early Access)

    9. In “Step 2/2 the new data store in a database repository(Early Access)”, perform the MySQL settings. After setting you press the “End”.

    Connection Type: Connection is retrieved via programmatic connection
    Database DataSource Name: java:comp/env/jdbc/user_db
    JDBC Driver URL: jdbc:mysql://127.0.0.1:3306/user_db
    Password for Connecting to Database: xxxx
    Database User Table Name: auth_users

    10. In the “data store” tab, delete existing “embedded” the OpenDJ.

    goto, openam console, click subject its throw exception

    Suggest me, How to can fix this issue.

    #14748
     raje@gworks.mobi 
    Participant

    I have fixed AMUncaughtException, i missed to add some tables columns that is what this occur, i fixed this issue, But, after

    goto -> “Subject”->”User” tab, press “New” button and configured user details, than, click create a user, it throw error.

    follow this link i post a question to forum https://forgerock.org/topic/datasource-change-issue/

    #14762
     raje@gworks.mobi 
    Participant

    Sorry, Now i have fixed this issue, i have some miss configured in opanam mysql datasource. Now, its works fine.

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.

©2019 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?