Skip to main content

REST Applications and OAuth 2.0

REST Applications and OAuth 2.0

To authenticate a REST application via OAuth 2.0, do all of the following:

  • Configure the resource server containing the REST application as an OAuth 2.0 resource server.

  • Allow delegated authentication for %Service_WebGateway.

  • Make sure that the web application (for the REST application) is configured to use delegated authentication.

  • Create a routine named ZAUTHENTICATE in the %SYS namespace. InterSystems provides a sample routine, REST.ZAUTHENTICATE.mac, that you can copy and modify. This routine is part of the Samples-Security sample on GitHub (https://github.com/intersystems/Samples-SecurityOpens in a new tab). You can download the entire sample as described in Downloading Samples for Use with InterSystems IRIS, but it may be more convenient to simply open the routine on GitHub and copy its contents.

    In your routine, modify the value of applicationName and make other changes as needed.

Also see Optionally Defining Delegated Authentication for the Web Client.

Important:

If using authentication with HealthShare®, you must use the ZAUTHENTICATE routine provided by InterSystemsOpens in a new tab and cannot write your own.


FeedbackOpens in a new tab