Okta¶
Configure 3forge Enterprise to authenticate logins to the Web through an Okta identity provider, using the Okta plugin.
Prerequisites¶
- An application registered in Okta: It must use the authorization code flow, and its sign-in redirect URI must match
oauth.redirect.uriexactly. Its client ID and client secret are needed in the steps below. - The Okta plugin bundle:
amiokta.tar.gz, delivered by 3forge. See Installing Plugins for where bundles go and which files are accepted. - No other SSO plugin: Only one
sso.plugin.classcan be active, so the Okta plugin and the generic OAuth plugin cannot both be used. The Okta plugin is a separate plugin with its own id and class, and it reads a smaller set of properties.
Steps¶
- Copy
amiokta.tar.gzinto the installation'splugins/directory without extracting it. -
Add the Okta connection details to
config/local.properties: -
Restart AmiCore.
- Open the Web's address in a browser. The login redirects to Okta.
Result¶
After a successful sign-in, Okta redirects the browser back to the Web, already signed in as the user named by oauth.username.field.
To confirm the plugin loaded, run ami_web.showPlugins() in the f1 console. The SSO manager lists the plugin OKTA with the class com.f1.amioktaauth.AmiOktaOauthPlugin.
Endpoints¶
The endpoints default to Okta's default authorization server, /oauth2/default/v1/authorize and /oauth2/default/v1/token. To use a custom authorization server, set both properties:
Start every endpoint with /. The plugin joins the domain and the endpoint with a further / when it signs a user in, so that address contains a double slash. It uses the domain and the endpoint as written when it renews a token, so an endpoint without a leading slash breaks renewal.
Scope¶
The default scope is openid profile email offline_access. The offline_access scope requests a refresh token, which the session uses to renew. Set oauth.scope to change the scopes requested.
Mapping Okta claims to roles¶
Set a role property to the claim that carries it, then a values property listing the values that mean yes:
Set the field and values properties together. A field without its values property fails the sign-in with an error.
Claim names can be nested with a dot. Claims from the ID token are also added to the user's attributes as amiscript.variable.<claim>, for example amiscript.variable.email.
Session renewal¶
An open session renews its access token when the token expires, using the refresh token, and the session ends if the renewal fails.
Other properties¶
oauth.code.challenge.method: Leave it unset. It defaults toS256, but the plugin also reads the same key as the digest algorithm name, so setting it, even toS256, breaks the code challenge.oauth.dynamic.redirect: Whentrue, the redirect URI is built from the address the browser used to reach the Web, keeping the path fromoauth.redirect.uri. It defaults tofalse.oauth.debug: Whentrue, the log records the authorization exchange in detail, including the token request'sAuthorizationheader, which encodes the client secret, and the refresh token. It defaults tofalse. Turn it off after setup.
What this plugin does not support¶
- No sign-out at Okta: The plugin has no logout handling, so signing out of 3forge Enterprise does not call Okta's logout endpoint.
- Fewer properties than the OAuth plugin: It does not read
oauth.logout.*,oauth.refresh.*,oauth.ami.roles.*,oauth.validate.certs, oroauth.session.check.period.seconds, so setting them has no effect. - Certificates are always validated: Okta's TLS certificate is validated on token requests, and there is no option to turn that off.
- No REST or WebSocket login: This is a browser-redirect flow, so it authenticates the Web only. See Authentication if REST or WebSocket clients need authenticating too.