OpenAM is an open source platform developed by ForgeRock that provides a single sign-on feature. Many different platforms can be used for identity mapping, such as RDBMS, LDAP, etc. OpenAM also provides authentication through social networking site like Facebook, Google+, etc.
First of all, using OpenAM as Identity provider, we need to connect OpenAM with the database. Therefore, in this post, I will focus on configuring the OpenAM connection with any database. Below is a step-by-step description to configure OpenAM with the database using Postgres.
<Resource name="jdbc/opensso" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/mydb" username="****" password="****" maxActive="20" maxIdle="10" maxWait="-1"/>
Note: All entries above for adding JNDI resource are according to the Postgres database. Use these parameters according to your preferred database.
Now we will configure OpenAM to connect with the database.
Authentication Module Configuration
Note: Since this setting also requires a JNDI name, I used the same JNDI name that is specified in the Prerequisites section. Because I am using the Postgres database for my setup, I used the setting according to my database as shown in above image.
We need to chain our authentication module so that whenever any request comes for this Realm, our configured module will server that request.
Data Store Configuration
Finally, we will configure the data store for this setup.
Note: In addition, OpenAM configuration creates logs into its configured directory in Windows under the “users/<user-name>” (i.e. “C:\Users\manish.sharma1\“) folder. There is one OpenAM folder that contains all of the setup files and log files related to this OpenAM configuration. If it’s required to do this setup from the beginning again, or if any error has occurred during this setup, delete the OpenA and .openamcfg folders and start the configuration again from scratch.