Wednesday, August 12, 2015

OpenAM 13 : Stateless Sessions

OpenAM 13 is scheduled to be released in Q4 2015, according to OpenAM Roadmap.



One of the new features I am looking forward to is Stateless Sessions for Scale and Elasticity. There is a slide (Customer Scale: Stateless Sessions and Managing High-Volume Digital Services) that can better illustrate this feature.


Basically, what we know of OpenAM now is it can only handle stateful sessions. This means in a highly-available deployment, failover storage (OpenDJ used as CTS) is required. This makes deployment slightly more tricky and at times cumbersome. It is especially true if multiple data centers are involved.



In some deployments where session failover is not required, a stateless session architecture is much preferred. Cleaner and faster. SSO product like CA SiteMinder is stateless by default.



.


Wednesday, August 5, 2015

Tomcat container log file is filling up with messages from OpenAM's OAuth authorization service

I was browsing through OpenAM 12 documentation and came across the Troubleshooting section.


There is this particular FAQ that caught my attention.

Q: My container log file is filling up with messages from OpenAM's OAuth authorization service and OpenID Connect provider. What can I do to prevent all these messages from being logged?

I shall paste the answer shamelessly from the OpenAM documentation.

A:

This behavior is governed by the log settings for RESTlet, which is used by OpenAM for OAuth 2.0 and OpenID Connect 1.0. Use log configuration settings to turn off logging from RESTlet.

For example, if your container is Apache Tomcat, follow these steps.

1. Stop Tomcat.
$ /path/to/tomcat/bin/shutdown.sh
       
2. Edit the Tomcat settings script, catalina.sh or catalina.bat, to use the logging configuration file.
For example, in /path/to/tomcat/bin/catalina.sh, uncomment the following line, and then save your work:

LOGGING_CONFIG= \
  "-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"

3. In $CATALINA_BASE/conf/logging.properties, add the following line, and then save your work:
org.restlet.level=OFF
       
4. Start Tomcat.
$ /path/to/tomcat/bin/startup.sh


I have seen these logs in catalina.out in my customer's Tomcat servers, but did not find the time to find out why they appear there. This solves the mystery. :)

.



Saturday, August 1, 2015

Device Identification to prevent Session Hijacking

This slide was from a webinar from CA I attended. It talked about how to prevent session hijacking by using device identification techniques.



So, besides ensuring the user is coming in from a "trusted" device during initial authentication, each access to a protected application is validated again. 

This can be quite resource intensive, but if an application is sensitive and of highest importance to customers, then it makes sense.

.




Thursday, July 23, 2015

Goggle OAuth2 Authentication Module in OpenAM - Part II

I find the following OAuth 2.0 Playground from Google very useful.


Step 1 exposes all the possible APIs/Scopes that are "query-able". 




Step 2 allows one to exchange authorization tokens with Google.

Steps 3 allows listing possible operations.



Finally, one can send a request to Google OAuth2 Provider.



A response is returned with requested information.



I find this very useful when trying to configure Google OAuth2 authentication module in OpenAM.


Wednesday, July 22, 2015

Goggle OAuth2 Authentication Module in OpenAM

I was configuring OAuth2 Authentication Module in OpenAM and trying to integrate with Google OAuth2 Provider.




I need the user profile and email from Google.  I know this has to be set in the Scope. So, I tried "profile, email".




But I kept getting the following error:


Error: invalid_scope 

Some requested scopes were invalid. {valid=[https://www.googleapis.com/auth/userinfo.email], invalid=[profile,]}




After I removed the comma, it works!



Very strange! I recalled the Scope for Facebook was email, read_stream. The hint is as follows:

The OAuth scope is a comma-separated list of values that define the type of information that can be retrieved from the user profile service. The values will depend on the type of permissions that the user has given to the user profile application in the OAuth 2.0 Provider.

Example: email, read_stream



.

Tuesday, July 21, 2015

ForgeRock Professional Service

These days, when ForgeRock sells subscriptions, it has an option to purchase Professional Service as a bundle. Free or not? I'm not too sure. It's part of price negotiation, I believe. 

The ForgeRock Professional Service can be utilized as follows: 


I think the original intend is to get customers up-to-speed with Open Identity Stack (OIS) deployment. This is especially helpful/applicable to customers who are more technical-savvy and would like to deploy OIS by themselves. High-level Architecture Workshop will be helpful.

Now, what if a SI who is well-trained in OIS is involved?

Customers, being customers, will want to cut cost. Always.

The worst case scenario is for a customer to ask the SI to cut-off a few man-days from implementation cost, since the customer can utilize Product Specialist Field Assistance. Wow! Unbelievable, isn't it? Nay, this should not happen at all and it really doesn't make sense. If customer insists, I think the best way is to walk away.


I think this Professional Service should be best utilized in Production, especially On-Site troubleshooting and Performance Analysis. There will be situations (or there had been?) where a site is badly deployed by a so-so System Integrator (SI) and is now causing production issues. It would be real hard for support engineers to provide remote support. An on-site troubleshooting comes in handy.


.


Wednesday, June 24, 2015

Open Identity Stack - Common Audit Framework

I'm looking forward to the Common Audit Framework in the next release of Open Identity Stack (OpenAM, OpenIDM, OpenDJ and OpenIG). 




At present, each component is logging in its own format and to different targets (e.g. file-system, database, syslog). Thus making debugging across components tedious.

This is definitely a good move!

.

Tuesday, June 23, 2015

ForgeRock OpenIG - API Gateway

API Gateway is getting hot these days. In fact, within a span of 2 months, I have 3 potential customers asking for API Gateway solutions.

There are already a few API Gateway solutions out there in the market - namely CA API Management (aka Layer 7), Oracle API Gateway and Mulesoft API Manager.


Well, ForgeRock is now enhancing OpenIG to be a API Gateway!


* Slide extracted from the recent 2015 Identity Summit in US.

You can view the slides from The Platform Big Picture.


.

Sunday, June 21, 2015

Shared Consent Atrribute Name

This blog was meant to be published last month but I was held up with moving to new office. (Yes, we are now in Fusionopolis Place, situated right next to INSEAD and the MRT/Metro is right below our building.)

Of course, in between, I had a short family vacation in Phuket, Thailand where I ran the 10th Laguna Phuket International Marathon.
 



Back to today's topic ...  Lets's assume a scenario as follows:

  1. OpenAM acts as a OAuth 2.0 Provider
  2. An application is protected with OAuth 2.0 (aka it is OAuth 2.0 Client enabled)

When an user access the application for the 1st time, the OAuth 2.0 client will redirect to the OAuth 2.0 provider. In this example, the OAuth 2.0 provider is OpenAM. Thus the OpenAM Login Page will be displayed.

After successful authentication, OpenAM will present the user with an authorization decision page.




When the checkbox is ticked and Allow button is clicked, the user entry in LDAP will be updated, specifically an attribute that was defined during configuration in OpenAM console "Shared Consent Attribute Name". In this example, the attribute name is defined as oauth2consent.





When the user entry is updated, the aooauth2consent attribute will be populated with the following data format:

 [oauth 2.0 client name] [attribute1] [attribute2] [attribute3] ...







Now, in some scenarios, for example Intranet applications, customers would not like the authorization decision page to be shown. 
How can we workaround this since OpenAM does not have the capability to hide this page at the moment?

The simple solution is to provision directly to the LDAP, specially the oauth2consent attribute with the data format shown above. 




PS: Do remember to add oauth2consent into LDAP User Attributes in Data Store. Otherwise, OpenAM is not able to update the user attribute in the LDAP.







Friday, May 22, 2015

Huge IoT Market

I was watching The Identity of Things & The Smart Cities of Tomorrow Webinar May 2015 (YouTube here).


There was a slide that caught my attention.



Huge numbers! IoT is getting more and more exciting!

And my team was joking that IPv6 has not been adopted widely enough, at least in our region. How are we going to see IoT happening?

.

Wednesday, May 13, 2015

New Sign-In from Chrome on Windows - Adaptive Risk Authentication

I was using a shared laptop just now and tried logging on to Gmail. As soon as I logged in, I received an email from Google warning me of "New Sign-In from Chrome on Windows".



This feature is good especially now that the Internet seems an "unsafe" place to be in. :>

Can the same feature be implemented in OpenAM? I believe it is possible by extending the codes in Adaptive Risk Authentication module.

Shouldn't be too difficult to achieve. Let me find some time. :)

.



Monday, May 11, 2015

Online export of OpenAM Configuration data from OpenDJ

We all know that the OpenAM configuration which we managed via the OpenAM Administration console is stored in either an embedded OpenDJ server (by default) or an external OpenDJ server.




For production systems, it would be recommended to backup the OpenAM configuration data nightly, specifically ou=services,o=[your organization]. 

I'm not too sure about ou=opensso adminusers,o=[your organization], but I'll backup a copy just to play safe.



Operationally, how huge will this OpenAM configuration data be? I can safely say it's very small. Will it have any performance hit on the OpenDJ server? Not likely. If the OpenDJ server is embedded which shares the same JVM as OpenAM, will it affect the functioning of OpenAM server? Not likely.

Anyway, we are talking about backup during off-peak hours, ain't we?

.

Friday, May 8, 2015

Porting embedded OpenDJ in OpenAM to external OpenDJ - Part IV

I blogged a few times on the procedures to port embedded OpenDJ in OpenAM to external OpenDJ. See Part I, Part II and Part III.




So we are happily done with the migration from embedded to external OpenDJ. What's next?

There is a last mile -- clean up!

Remember the old embedded OpenDJ is started whenever OpenAM is started? It stays in the same JVM as OpenAM (you'll get it if you are in the Java world).

So this is to say even if OpenAM is configured to point to external OpenDJ, the old embedded OpenDJ will always be started whenever OpenAM is started. Simple logic.

So, how can we stop the old embedded OpenDJ from starting?

.../[openam-configuration-directory]/opends is where the embedded OpenDJ stays. 

Remove or rename the folder will do the trick. (I usually rename, never remove in case I want to roll back)


Done.

.



Thursday, May 7, 2015

Data Store, LDAP User Attributes and Subjects

In my previous blog Global Session vs User Session, I mentioned how to go about configuring Session settings on a per-user basis. 

First, go to the Subjects tab and search for the User.



Then, we set a different Session setting for the user. In this example, we change the Maximum Idle Time for this user from the default 30 minutes to 60 minutes.



Fairly simple from UI perspective, but what really happens behind the scene?


There is a need to map Maximum Idle Time from the UI to an attribute in the user's LDAP entry. In this case, OpenAM makes use of an attribute iplanet-am-session-max-idle-time.



So that means OpenAM needs to be able to edit the user's LDAP entry. (see the other blog of mine) More importantly, the backend Data Stores (e.g. LDAP) must have the necessary attributes defined in the schema. (e.g. iplanet-am-session-max-caching-time, iplanet-am-session-max-idle-time, iplanet-am-session-max-session-time, iplanet-am-session-quota-limit)


In Data Stores, click on the appropriate backend. 



Scroll to the section LDAP User Attributes. Ensure that the necessary attributes are defined. 



Embedded OpenDJ
If the backend is an embedded OpenDJ that is installed together with OpenAM, then we are fairly sure the OpenDJ schema is populated with the required session attributes. The schema is defined in ...//opends/config/schema/99-user.ldif .

External OpenDJ
If the backend is an external OpenDJ, we need to ensure the external OpenDJ is chosen during OpenAM installation. The installation will ensure the appropriate attributes are created in 99-user.ldif.

If the external OpenDJ is configured post OpenAM installation, then we need to ensure 99-user.ldif from the embedded OpenDJ is copied to the the external OpenDJ. One can choose to load the schema manually with pre-defined ldif files in ...//ldif/opendj/.



The above 2 scenarios are quite straight-forward. What if the backend is Microsoft Active Directory or any of the supported user data stores?



Remember we said earlier that we need to load the necessary attributes into the OpenDJ schema? The same has to be done on any other User Data Stores. 

Well, this becomes tricky. 

Will the AD administrator allow non-AD related attributes to be created on the AD? Likely not. This is not a technical issue, but an operational one.


.

Wednesday, May 6, 2015

Global Session vs User Session

We all know there is a Session tab in OpenAM Administration console listing all the current sessions in a particular OpenAM node. In the Session table, there are 2 columns "Max Session Time" and "Max Idle Time".



We all know that the Session for every user can be configured globally in Configuration ++ Global +++ Session.



Click on Session and scroll all the way down to Dynamic Attributes section. This is where Global Session is configured.


Is it possible to configure a different Maximum Session Time and/or Maximum Idle Time on a per-user basis in OpenAM? 

The answer is yes, but we seldom do that as this is really a operational headache. Some customers of ours will instead opt for different Session setting on a per-department basis. This will be via some customized codes in Post Authentication Processing module and determined by a certain attribute (e.g. departmentCode) in the users' LDAP (or Microsoft AD) entry. 

Suppose a customer insists on having different Session setting on a per-user basis, the following is how we go about achieving that. 

1) Go to Subjects tab and search for the user


2) We can see that the Session service is currently not available for this particular user. This implies the values are inherited from Global Session setting which we discussed earlier.

3) Click on Add



4) Choose Session and click Next.



5) This is where different Session values can be set on a per-user basis. Click on Finish.


6) We are done.



Nice!

.

Tuesday, May 5, 2015

com.sun.identity.idm.IdRepoException: No plug-ins configured for this operation


In Data Store ++ Plug-in Configuration +++ LDAPv3 Plug-in Supported Types and Operations, the default settings for realm, user and group are grant-all operations.



In Production, it is a good practice to restrict the operations that are allowed for OpenAM to execute on the backend data store. e.g. OpenDJ or Microsoft Active Directory.

The rationale is simple. We only want OpenAM to consume data from the backend data stores. OpenAM shall not be used as an Identity Management tool.

For most of our deployment, we will remove create and delete operations. For one of our customers, edit operation is intentionally not removed as we have custom codes in Post Authentication Processing module that will update some attributes in users' LDAP entries.




Recently, we launched Facebook social login for this customer.




The following OAuth 2.0 Authentication Features is lifted from ForgeRock Wiki:

  1. The module offers the possibility to authenticate a user and map the account in different ways:
    1. Without any local identity in the OpenAM, however identifying the user by one of the attributes provided by the OAuth 2.0 provider
    2. Map the user to an "anonymous" account in the OpenAM
    3. Map the user to a local identity based on the attributes received from the OAuth 2.0 Provider
    4. Create an account on the fly on the OpenAM local user data store with the attributes received from the OAuth 2.0 Provider
  2. Global Logout as an option to also terminate the session with the OAuth 2.0 Provider
  3. Provide the access token and attributes obtained to trusted applications that use the OpenAM
  4. The Account Mapper, Attribute Mapper and Email gateway can be extended since they are implemented as plug-ins

So, during unit testing, we always hit into "com.sun.identity.idm.IdRepoException: No plug-ins configured for this operation" error during Step d.

We were initially lost, but eventually realised it was caused by the missing create operation in LDAPv3 Plug-in Supported Types and Operations.



Once the create operation is added, the Facebook account is now able to be created on the fly.


.

Monday, April 27, 2015

OpenDJ Replication Architecture

The way OpenDJ replicates data from one node to the other is slightly different from Sun/Orace Directory Server. OpenDJ utilizes Replication Servers for data replication as shown below:




I was reading OpenDJ Mailing List the other day and came across a great response from Chris Ridd:

The key difference in OpenDJ is that replication is not configured between pairs of servers like it often is in other products.

Instead, OpenDJ logically consists of a number of replication servers that are “fully meshed”, i.e. every replication server is connected to every other replication server. The replication servers hold the changelogs, but no LDAP data. OpenDJ also has directory servers that hold LDAP data that connect to replication servers in order to send and receive changes.

(You can configure an OpenDJ server to be a pure directory server (a DS) or a pure replication server (an RS) or both at the same time (DS+RS). The setup tool will create all of these combinations for you.)

When you use “dsreplication enable”, you are effectively adding a new node (--host1) to the existing fully meshed topology (--host2 can be any host in the topology). As Jean-Noël mentioned, the replication servers exchange views of the topology, so when you add a new replication server to the topology, it automatically becomes connected to every other replication server in the topology.


Good read!