Skip to main content

OAuth-erize The Nation! With OpenIG 3.0

OpenIG 3.0 was released a couple of weeks ago, with some significant enhancements.  One of which was the ability to protect applications through the use OAuth2 access tokens, with very little effort.

OAuth2 has been around for a while, and provides a lightweight and developer friendly way to leverage authorization services for web and native applications.  To utilise the features of OAuth2 such as access token validation, refresh token to access token exchange and then scope querying by the client application, generally requires code changes within both the client app and resource servers.  This isn't necessarily a bad thing nor particularly complex, but in some circumstances,  you may not have access to the underlying code, or perhaps the app is hosted by a 3rd party.

OpenIG, as it's a reverse proxy, can easily sit in between the user community and the underlying target application.  With a simple edit of a JSON file, OpenIG can be setup to act as both the resource server and client in an OAuth2 or OpenID Connect environment.

The installation of OpenIG is trivial. A simple Java web application that can be dropped into either a Tomcat or Jetty container.  The app bootstraps from a locally stored configuration folder.  A standard config.json file should be created in the ~/.openig/config/ directory (or equivalent home directory on Windows).  This file contains the entire setup for IG, with things such as handlers, chains and clients, that perform the necessary request checking, stripping or parsing of attributes and replay into the target applications.  Of course, one of the benefits of OpenIG, is that itself, can indeed be protected by an OpenAM policy agent, and utilise any attributes that can be passed downstream to IG.

Following the simple example that comes with the OpenIG documentation, setting up integration a an OIDC relying party is pretty quick.  OpenAM can quickly be configured as the OAuth2 provider, as this functionality is available out of the box and configurable via one of the OpenAM Common Tasks wizard.

The example configuration for setting up IG as an OAuth2 client basically has two main components - an overall handler object (OpenIDConnectChain) that initiates the interaction to the OAuth2 provider and an out going handler, that retrieves the necessary attributes from the OIDC scope, and replays them into the target application as the necessary username and password.  There's also a capture filter for logging.  In production, you perhaps wouldn't necessarily replay the password here, but it would depend on the underlying application.

The OpenIDConnectChain, contains an OAuth2ClientFilter object conveniently called OpenIDConnectClient!  This object, contains the necessary OAuth2 provider details - URL, clientID, requested scopes and so on.  The information retrieved by the request is actually stored in the target attribute - ${exchange.openid}.  This attribute can then be queried by the out going chain, namely the GetCredentials object, which is a Groovy scriptable component.  Being scriptable, means we are pretty free to extend this as we see fit.  In this example, the GetCredentials object, simply pulls out the username and password fields.  Those fields are then passed down to the LoginRequestFilter object, which replays the fields into a form in the protected application.

Mega simple!  The beauty of it, is that underlying application (in this case the Java sample HTTP that comes with the OpenIG document)  requires zero code changes. All of the configuration is abstracted into the OpenIG proxy.

The same process can easily be repeated for other federation protocols such as SAML2.


Popular posts from this blog

WebAuthn Authentication in AM 6.5

ForgeRock AccessManagement 6.5, will have out of the box integration for the W3C WebAuthn. This modern “FIDO2” standard allows cryptographic passwordless authentication – integrating with a range of native authenticators, from USB keys to fingerprint and facial recognition systems found natively in many mobile and desktop operating systems.
Why is this so cool? Well firstly we know passwords are insecure and deliver a poor user experience. But aren’t there loads of strong MFA solutions out there already? Well, there are, but many are proprietary, require complex integrations and SDK’s and ultimately, don’t provide the level of agility that many CISO’s and application designers now require. 
Rolling out a secure authentication system today, will probably only result in further integration costs and headaches tomorrow, when the next “cool” login method emerges.
Having a standards based approach, allows for easier inter-operability and a more agile platform for change.
AM 6.5 has int…

Implementing Zero Trust & CARTA within AM 6.x

There is an increasing focus on perimeterless approaches to security design and the buzzy "defensive security architectures".  This blog will take a brief look at implementing a contextual and continuous approach to access management, that can help to fulfil those design aspirations.

The main concept, is to basically collect some sort of contextual data at login time, and again at resource access time - and basically look for differences between the two.  But why is this remotely interesting?  Firstly, big walls, don't necessarily mean safer houses.  The classic firewall approach to security.  Keeping the bad out and the good in.  That concept no longer works for the large modern enterprise.  The good and bad are everywhere and access control decisions should really be based on data above and beyond that directly related to the user identity, with enforcement as close as possible to the protected resource as possible.

With Intelligent AuthX, we can start to collect and s…

Forget Passwordless, What About Usernameless?

A year or so ago, I blogged about the wonderful world of passwordless and how WebAuthn was going to save the world!  Gone will be insecure passwords, with their terrible user experience, and contributions to data breaches and in with a standards driven, crypto based, technology agnostic way of authenticating a user. The panacea!  Well, the panacea might just be getting be getting a little better.

Take a look at the above blog for a quick "reccy" on how WebAuthn works and the main flows.  TLDR; we're using public/private key pairs for each website or service we want to authenticate against.  The private key gets stored somewhere safe - namely within the dedicated USB authenticator fob, or within the secure element on an operating system.

In ForgeRock Access Management 7.0 EA, the WebAuthn registration authentication node has been modified to now include a "Username to device" switch.  This essentially allows a user handle to be sent back down to the authenticato…