Article Pravin Barton · Sep 1, 2022 4m read Using OAuth 2.0 / OIDC for single sign-on to an IRIS REST application Say I've been developing a web application that uses IRIS as the back end. I've been working on it with unauthenticated access. It's getting to the point where I would like to deploy it to users, but first I need to add authentication. Rather than using the default IRIS password authentication, I'd like users to sign in with my organization's Single Sign On, or some other popular identity provider like Google or GitHub. I've read that OpenID Connect is a common authentication standard, and it's supported by IRIS. What is the simplest way to get up and running? #Best Practices #OAuth2 #REST API #InterSystems IRIS 7 2 3 1.1K
Article Pravin Barton · May 12, 2022 1m read Making an existing property Required in a Persistent class Say I have a persistent class in IRIS with an optional property EmailOptIn: Class Person Extends %Persistent { Property Name As %String; Property EmailOptIn As %Boolean; } I later realize that I'm doing a lot of null-checking on this property where I shouldn't need to. The solution is to make this a required property: #SQL #InterSystems IRIS 6 7 0 495
Article Pravin Barton · May 1, 2020 1m read Code sample to concatenate JSON arrays ObjectScript doesn't include any built-in method for appending one JSON dynamic array to another. Here's a code snippet I use that's equivalent to the JavaScript concat() method. Call it with any number of arguments to concatenate them into a new array. If an argument is a dynamic array, its elements will be added. Otherwise the argument itself will be added. #Code Snippet #JSON #InterSystems IRIS 7 2 3 825
Article Pravin Barton · Mar 28, 2019 2m read ObjectScript error handling snippets ObjectScript has at least three ways of handling errors (status codes, exceptions, SQLCODE, etc.). Most of the system code uses statuses but exceptions are easier to handle for a number of reasons. Working with legacy code you spend some time translating between the different techniques. I use these snippets a lot for reference. Hopefully they're useful to others as well. #Best Practices #Code Snippet #Error Handling #ObjectScript #Caché #InterSystems IRIS 24 5 21 3.7K
Article Pravin Barton · Apr 26, 2017 1m read Moving a global to a new database using extended global reference Say you have a global in one database that you instead want to map from a different database. If you just create a global mapping to the new database, the existing global will become inaccessible because it still lives on the old database. The documentation notes this problem here but doesn't give details on how to fix it. #Caché #ObjectScript #Mapping 3 7 0 1.3K
Article Pravin Barton · Jan 13, 2017 2m read Binding of the "this" variable in Zen custom components I thought I'd share some issues I had today with Zen development in a custom component. Say we have created a Zen composite component with a few javascript methods that modify its child components. In order to modify these components, we can use something like the following method: #JavaScript #ZEN #Caché 3 0 0 388