Configure the OpenEdge Authentication Gateway to use OAuth2
- Last Updated: January 17, 2023
- 4 minute read
- OpenEdge
- Version 13.0
- Documentation
Configure the OpenEdge Authentication Gateway using the sts.properties file based on the OpenEdge domains and the OAuth2 server token requirements.
Add OpenEdge domains
Every user must belong to a defined OpenEdge domain. Edit the domains.json file to configure new domains.
Configure domain- Edit
instance-name/webapps/ROOT/WEB-INF/config/domains.json
by replacing the
instance-namewith the OpenEdge Authentication Gateway server name. - Add the
progress.comdomain and set theenabledvalue totrue. - Under
exchange, setenabledtotrue. - Set
authProvidertoanonymous."version": "1.0.0", "domains": [ { "name" : "progress.com", "enabled" : true, "description" : "JWT token authentication", "actions" : { "authenticate" : { "enabled" : false, "options" : "" }, "exchange" : { "enabled" : true, "options" : "" }, "sso" : { "enabled" : false, "options" : "" }, "refresh" : { "enabled" : false, "options" : "" } }, "options" : "", "authProvider" : "anonymous", "policyProvider" : "", "events" : { "provider" : "", "groups" : { } } } }Note: Whenexchangeis enabled for your domain, the OpenEdge Authentication Gateway identifies the inbound token as an OAuth2 token for your domain. - Save the file.
For more information about domains, see Configure domains.
Configure OpenEdge domain access codes
Each new domain must have a domain name and passwordkey access code. The codes are
secured by adding them to a keystore using a plain text file and the
gendomreg command.
- Edit the
instance-name/webapps/ROOT/WEB-INF/config/domainsks.csv
file to include all new domains in the domain.json file.
.... , oests.server,passwordkey, progress.com,mypasswordNote: Replaceprogress.comandmypasswordwith your domain and secure encrypted password. - Save the file.
- Generate the keystore using
gendomreg.gendomreg domainsks.csv domains.keystoreNote: Remember to remove the CSV file from the instance directory and store it in a secure location after generating the keystore because the CSV file contains passwords.In a keystore, the domain access codes are more secure than in a plain text CSV file.
For more information about domain access codes, see Configure domain access codes.
Set the keystore properties
Configure the OpenEdge Authentication Gateway to use the encrypted keys used to lock the JWT token.
- Identify the keystore type. This example uses the most common keystore, JWK or JSON Web Key. It represents a cryptographic key and requires a URL that points to a JWK set of public keys or digital certificates downloaded from the authorization server.
- Edit the keystore type and any related properties in the instance/webapps/ROOT/WEB-INF/config/sts.properties
file to use the
jwk. Set the related properties.URL for the JWK of the authorization server jwtToken.keystore.path=${Catalina.base}/conf/tomcat-keystore.p12Note: Choosing a differenttyperequires different property changes. - Save the file.
For more information about JWT keystores, see Configure an OAuth2 keystore .
For more information about managing keys and certificates, see Manage OpenEdge Keys and Certificates .
Configure validation of bearer token claims
- Local validation—Validate on the OpenEdge Authentication Gateway server.
- Remote validation—Validate on the OAuth2 authorization server.
This example uses remote validation.
Local validation
The bearer token must pass the payload requirements, data integrity signature, and (optionally) expiration. The client’s request is rejected, if any checks fail.
To validate the token claims:
- Identify and then set the
tokenServicesproperty value. This example uses JWT, which provides thejwttoken. - Edit oeauthserver/webapps/webapp-name/WEB-INF/config/sts.properties to
set
oauth2.resSvc.tokenServicestojwt.oauth2.resSvc.tokenServices=jwtNote: This value is either thejwtoroauth2access token validation process. If you use Configure OAuth2 or JWT Token Validation Servicesoauth2, you must setoauth2.resSvc.clientIdto the value provided by your authorization provider. - Save the file.
For more information about oauth2.resSvc.tokenServices, see ../../pas-for-openedge-management/page/Configure-OAuth2-or-JWT-Token-Validation-Services.html.
When using opaque tokens, the OpenEdge Authentication Gateway cannot access the content of the token. Opaque tokens require setting properties to enable remote validation.
- Edit oeauthserver-dir/webapps/webapp-name/WEB-INF/config/sts.properties.
- Set the
oauth2properties for remote validation.oauth2.opaqueToken.instrospectionUri=http://hostname:port/introspect oauth2.opaqueToken.clientSecret=stringClientSecretNote: Configure OAuth2 or JWT Token ValidationSettinginstrospectionUrioverrides the local validation properties. Use thegenpasswordutility to encrypt the stringClientSecret on production systems. - Save the file.
Configure token exchange
During the validation, token information is automatically stored in a client-principal object. The access token fields are automatically added to the client-principal object. For configurations using authorization servers that support OpenID Connect (OIDC), you can configure the OpenEdge Authentication Gateway to collect additional user information and store it in the client-principal.
Add access tokens values to a client-principal objectBy default, the OpenEdge Authentication Gateway converts the access token to a client-principal object. The following table provides the mapping of self-contained JWT fields to OpenEdge client-principal attributes:
| JWT field | Client-principal attribute |
|---|---|
| sub (by configuration) | USER-ID and DOMAIN-NAME |
| exp | LOGIN-EXPIRATION-TIMESTAMP |
| scope (by configuration) | ROLES |
| misc (by configuration) | Converts to user-defined properties. |
misc name value
pairs are converted to additional user-defined properties on the client-principal.
For more information about token conversion, see Configure JWT/OAuth2 self-contained access token conversion to an OpenEdge client-principal.
Add identity token data to the client-principal
If the authorization server supports OpenID Connect (OIDC), then set the OAuth2 properties to collect and add identity token details to the client-principal object.
- Set the OIDC related
properties.
OEClientPrincipalFilter.userinfo.servicetype=oidc OEClientPrincipalFilter.userinfo.url=http://authorizationServer:port/userinfoNote: PAS for OpenEdge usesoauth2.resSvc.clientIdto request client information from the authorization server.