Okta Integration
Overview
This section provides instructions on:
Okta authentication: How to configure WorkflowGen authentication using Okta.
Okta user provisioning: How to create a directory with the self-provisioning connector.
Okta configuration for mobile apps: How to authorize WorkflowGen access to mobile applications using Okta.
Okta configuration for server-side scripts: How to authorize WorkflowGen access to server-side scripts using OpenID Connect and Okta.
Okta configuration for single-page applications: How to authorize WorkflowGen access to single-page applications using Okta.
Okta configuration for the WorkflowGen CLI: How to authorize Okta access to the WorkflowGen command line interface.
Generating a universal link for WorkflowGen Plus: How to generate a universal link to simplify the WorkflowGen Plus mobile app user login.
It also provides additional information on WorkflowGen SOAP API services support and Web service type application support.
In the instructions, substitute <workflowgen url>
with the domain and path to your WorkflowGen instance; for example, localhost/wfgen
or www.mycompany.com/wfgen
.
Okta authentication
This section provides instructions on how to configure WorkflowGen delegated authentication with Okta. At the end of this section, you'll have a working WorkflowGen instance using Okta to authenticate your users.
If you don't need the GraphQL API, you won't need to create an authorization server. See the Configuring the authentication without the GraphQL API section for instructions.
Prerequisites
Make sure to have a licensed copy of WorkflowGen installed and running on a server. You must be a WorkflowGen administrator.
Make sure to have an Okta administrator access to be able to configure it properly.
Make sure to have provisioned an existing Okta user that you can authenticate with to WorkflowGen and that the user has administrator privileges. This is important because once you've activated the delegation, you'll still need to be able to manage the application. (The Okta user is in fact a user of an identity provider that's linked to Okta, such GitHub or Google. You have to provision at least one of the users.)
AES encryption mode and its key are required for the authentication to work.
The WorkflowGen user's username must match their Okta user's username in order to identify and authenticate the correct user from Okta.
To test your configuration after the steps below, you can add an Okta user in the Okta portal's Users section.
When importing users into WorkflowGen from the Okta database, make sure to set the username as the email (e.g.
john.doe@example.com
).
Configuring the authentication with the GraphQL API
The configuration of Okta will be done in several steps. First, you have to configure an authorization server in the web interface; then, you have to add a regular web application.
The WorkflowGen GraphQL API (authorization server) configuration is required if you want to use the WorkflowGen Plus v2 mobile app.
Step 1: Create an authorization server
An Okta authorization server is a logic element that defines the security boundaries of your system when an application wants to access your resources via an API.
An authorization server defines your security boundary, and is used to mint access and identity tokens for use with OIDC clients and OAuth 2.0 service accounts when accessing your resources via API. Within each authorization server you can define your own OAuth scopes, claims, and access policies. Source: Information sidebar in Okta's administrative panel
You can find more information on authorization servers on the Okta developer website.
To create an authorization server with a classic usage:
Go to the Okta Developer portal and log in to your account.
In the left panel, choose API under the Security menu.
Click the Add Authorization Server button on the Authorization Servers tab.
Enter the following information:
Name:
WorkflowGen GraphQL API
Audience:
<workflowgen url>/graphql
Description:
WorkflowGen GraphQL API
(or whatever description you want)
Click the Save button.
To create an authorization server with multi-audience support:
Go to the Okta Developer portal and log in to your account.
In the left panel, choose API under the Security menu.
Click the Add Authorization Server button on the Authorization Servers tab.
Enter the following information:
Name:
My APIs
Audience:
my-apis
Description:
Authorization server for all my APIs
(or whatever description you want)
Click the Save button.
Step 2: Add the scope
For classic usage:
Click the Add Scope button.
Enter the following information:
Name:
default
Display phrase:
default
Description:
Use the default scope if no other scope is specified
Default scope: Check
Set as a default scope
Click the Create button.
For multi-audience support:
Click the Add Scope button.
Enter the following information:
Name:
wfgen-graphql-full-access
Display phrase:
wfgen-graphql-full-access
Description:
Full access to the WorkflowGen GraphQL API
Click the Create button.
You've now properly configured your Okta authorization server for the WorkflowGen GraphQL API.
Step 3: Add a claim
Go to the Claims section, then click the Add Claim button.
Enter the following information:
Name:
com.workflowgen.api.username
Include in token type: Select
Access Token
Value Type: Select
Expression
Value: Enter the following Okta code:
Include in: Select
Any scope
Click the Create button.
Click the Create button.
Step 4: Add the server access policy
You now need to configure the authorization server access policy.
Go to the WorkflowGen GraphQL API authorization server's Access Policies tab.
Click the Add Policy button.
Enter the following information:
Name:
All Clients Policy
Description:
Enables all clients to have access to this application server›.
Assign to:
All clients
Click the Create Policy button.
Click the Add Rule button.
Enter the following information:
Rule Name:
All Grant Types; Any Scopes; Any User assigned
Leave the other settings set to their defaults.
Click the Create Rule button.
You've now successfully configured the authorization server access policy. There's just one more step needed in order for the client credentials flow to work, which will enable you to use machine-to-machine authentication with Okta and the WorkflowGen GraphQL API.
Step 5: Create the WorkflowGen web application
Go to the Okta Developer portal.
In the Applications item under the Applications menu, click the Create App Integration button.
Select the following options in Create a new app integration, then click Next:
Sign-in method:
OIDC - OpenID Connect
Application type:
Web Application
Enter the following information:
App integration name:
WorkflowGen
Grant type: Check
Authorization Code
Sign-in redirect URIs:
<workflowgen url>/auth/callback
Sign-out redirect URIs:
<workflowgen url>/auth/logout/return
Base URIs:
<workflowgen url>
without any path (just the base URL); for example,https://localhost
, if<workflowgen url>
ishttps://localhost/wfgen
Controlled access: Check
Allow everyone in your organization to access
Click the Save button.
On the General tab of your WorkflowGen web application page, click the Edit button in the General Settings section.
Enter the following information:
Initiate login URI:
<workflowgen url>/auth/callback
Click Save.
You've now successfully configured Okta for your WorkflowGen instance.
Review the registration
You should now have all the information you need to configure WorkflowGen to delegate the authentication to Okta. Here's a review:
WorkflowGen configuration
Now, you need to configure WorkflowGen to delegate its authentication to Okta.
Step 1: Add Okta values to the WorkflowGen web.config
web.config
Open the WorkflowGen web.config
file and add/update the following properties:
Classic usage:
With multi-audience support:
Replace
<CLIENT ID>
with the client ID of the WorkflowGen web application from Okta.Replace
<CLIENT_SECRET>
with the client secret of the WorkflowGen web application from Okta.Replace
<METADATA_URL>
with the Metadata URI property found in the WorkflowGen GraphQL API's settings page. Then, replace the last part,/.well-known/oauth-authorization-server
, with/.well-known/openid-configuration
(e.g.https://{YOUR_OKTA_DOMAIN}/oauth2/{AUTH_SERVER_ID}/.well-known/openid-configuration
).
You have probably noticed that the setting with the ApplicationSecurityAuthUsernameClaim
key is set to the value entered in a rule earlier. Therefore, you could use any value here provided that you also modify the rule.
For information about available configuration options to use with your instance, see the Web and Application Configuration Parameters appendix.
WorkflowGen is now linked to Okta and back. The last thing left to do is configure a few more options in order to finish the internal wiring of WorkflowGen so that it can delegate its authentication.
Step 2: Add some security values for session generation
In order to generate a session token, you need to add a few more settings to the web.config
file.
Open the WorkflowGen
web.config
file and add/update the following property:Replace
<SECRET>
with a value that can't be easily guessed, such as a UUID.
The secret will be only accessible inside your instance of WorkflowGen, so when generating a session token, WorkflowGen will sign it with this secret in order to check the validity of all session tokens passed to it.
Step 3: Activate the authentication delegation
You now need to activate the delegation by replacing the authentication system in IIS and pointing WorkflowGen's modules to the correct authentication module.
Configure IIS
In IIS Manager, click on the WorkflowGen application in the tree view.
Click the Authentication button.
Enable Anonymous Authentication, and disable all other authentications.
Perform these steps for all sub-applications as well.
Add properties to the web.config
files of certain modules
Certain modules need to have their authentication checked by the special Advantys.Security.JWTAuthenticationModule
WorkflowGen authentication module, but certain other modules should not because they are either public or aren't part of the global authentication system.
Open the WorkflowGen
web.config
file and add/update the following property:In the
auth
module'sweb.config
, add/update the following property:This line removes the authentication Node.js module from the global authentication system, because this Node.js application encapsulates the OpenID Connect authentication mechanisms.
Repeat the above two steps for the
hooks
andscim
modules as well.Copy the following .NET assemblies and dependency libraries from
\wfgen\bin
to each custom webform's\bin
folder (\wfgen\wfapps\webforms\<custom webform>\bin
):Advantys.My.dll
Advantys.Security.dll
Newtonsoft.Json.dll
jose-jwt.dll
You should now have a working WorkflowGen instance with the authentication delegated to Okta through the OpenID Connect protocol. Make sure to have provisioned your users to WorkflowGen in order for them to successfully access WorkflowGen.
Configuring the authentication without the GraphQL API
If for some reason you can't add an authorization server in your Okta account and you don't need GraphQL API authentication configured with the provider, you can avoid creating the server and configure WorkflowGen with the default Okta authorization server.
Step 1: Create the WorkflowGen web application
Go to the Okta Developer portal.
In the Applications item under the Applications menu, click the Create App Integration button.
Select the following options in Create a new app integration, then click Next:
Sign-in method:
OIDC - OpenID Connect
Application type:
Web Application
Enter the following information:
App integration name:
WorkflowGen
Grant type: Check
Authorization Code
Sign-in redirect URIs:
<workflowgen url>/auth/callback
Sign-out redirect URIs:
<workflowgen url>/auth/logout/return
Base URIs:
<workflowgen url>
without any path (just the base URL); for example,https://localhost
, if<workflowgen url>
ishttps://localhost/wfgen
Controlled access: Check
Allow everyone in your organization to access
Click the Save button.
On the General tab of your WorkflowGen web application page, click the Edit button in the General Settings section.
Enter the following information:
Initiate login URI:
<workflowgen url>/auth/callback
Click Save.
You've now successfully configured Okta for your WorkflowGen instance.
Step 2: Configure WorkflowGen
Add or update the following configuration options in the WorkflowGen web.config
file.
Change
MetadataUrl
tohttps://<YOUR OKTA DOMAIN>/.well-known/openid-configuration
.Change
UsernameClaim
topreferred_username
.Change
AuthAudience
to the client ID of the WorkflowGen web application configured in Okta.Set the
ApplicationSecurityAuthDecodeAccessToken
option toN
.
Keep in mind that by setting
ApplicationSecurityAuthDecodeAccessToken=N
, the expiration date of the session token generated by WorkflowGen will be based on that of the ID token.You won't be able to use the access token received from Okta to query the GraphQL API. This access token will give you access to the Okta API and nothing else. To query the GraphQL API, you'll need to configure its authentication with another method, like Basic authentication.
Classic usage:
Step 3: Add some security values for session generation
In order to generate a session token, you need to add a few more settings to the web.config
file.
Open the WorkflowGen
web.config
file and add/update the following property:Replace
<SECRET>
with a value that can't be easily guessed, such as a UUID.
The secret will be only accessible inside your instance of WorkflowGen, so when generating a session token, WorkflowGen will sign it with this secret in order to check the validity of all session tokens passed to it.
Step 4: Activate the authentication delegation
You now need to activate the delegation by replacing the authentication system in IIS and pointing WorkflowGen's modules to the correct authentication module.
Configure IIS
In IIS Manager, click on the WorkflowGen application in the tree view.
Click the Authentication button.
Enable Anonymous Authentication, and disable all other authentications.
Perform these steps for all sub-applications as well.
Add properties to the web.config
files of certain modules
Certain modules need to have their authentication checked by the special Advantys.Security.JWTAuthenticationModule
WorkflowGen authentication module, but certain other modules should not because they are either public or aren't part of the global authentication system.
Open the WorkflowGen
web.config
file and add/update the following property:In the
auth
module'sweb.config
, add/update the following property:This line removes the authentication Node.js module from the global authentication system, because this Node.js application encapsulates the OpenID Connect authentication mechanisms.
Repeat the above two steps for the
hooks
andscim
modules as well.Copy the following .NET assemblies and dependency libraries from
\wfgen\bin
to each custom webform's\bin
folder (\wfgen\wfapps\webforms\<custom webform>\bin
):Advantys.My.dll
Advantys.Security.dll
Newtonsoft.Json.dll
jose-jwt.dll
You should now have a working WorkflowGen instance with the authentication delegated to Okta through the OpenID Connect protocol. Make sure to have provisioned your users to WorkflowGen in order for them to successfully access WorkflowGen.
Okta user provisioning
The self-provisioning connector is a directory connector that automatically creates and synchronizes a user based on the user's session token claims that contain claims from the OpenID Connect provider ID token. This feature is only compatible with an OpenID Connect authentication.
Prerequisites
Make sure to have a working WorkflowGen instance.
Make sure to know the instance's IP address or its fully qualified name.
Make sure to know the address of the instance.
Make sure to have configured Okta or one of the other OIDC-compliant authentication methods (Azure Active Directory, AD FS, Auth0, or Microsoft Identity Platform v2.0).
WorkflowGen configuration
This section will guide you through the WorkflowGen configurations necessary to set up the self-provisioning feature with a directory.
Step 1: Create a self-provisioning directory
This directory will contain all of the users that are not provisioned elsewhere. To create a self-provisioning directory, do the following:
On the Directories page in the WorkflowGen Administration Module, click New directory.
Fill in the form:
Name:
SELF_PROVISONING
(or something else)Description: A good description of the directory
Directory connector:
Self-provisioning
Click Save.
Step 2: Configure the user fields-to-claims mapping
Now that you've created a new directory with the self-provisioning connector, you need to define which claims are mapped to which WorkflowGen user field. To do this:
On the new directory's page, click Edit mapping.
To the right of the name of the WorkflowGen user field, enter the name of the claim in the session token that you want to map.
Here's an example of a session token generated by the
auth
node application from the Okta ID token connected with Google Apps:These claims could be mapped in WorkflowGen like this:
✏️ Note: The Username and Name fields are required.
Click Save.
Okta configuration for mobile apps
Mobile applications must use an approach similar to that of regular web applications, which is called Authorization Code Flow with Proof Key for Code Exchange (PKCE). The main difference between this and the classic Authorization Code Flow is that the mobile application doesn't get a client secret, but instead exchanges a pair of codes to prove the origin of the authentication attempt. The issue is that a mobile application can't be trusted with a client secret because it's distributed directly to users and is therefore no longer under the developer's control, and the sources can be decompiled and analyzed to find secrets like this.
This section provides instructions on how to configure Okta for mobile apps so that your mobile users can benefit from delegated authentication as well.
Prerequisites
Make sure to have a licensed copy of WorkflowGen installed and running on a server.
Make sure to have administrative access to Okta to be able to configure it properly.
Make sure to have provisioned an existing Okta user with which you can authenticate to WorkflowGen so that you can use the application afterwards.
Make sure to have the WorkflowGen Plus mobile application installed on a device that you have access to.
Make sure to have the latest WorkflowGen Plus version installed on your device and that your device is supported.
Make sure to have successfully configured delegated authentication to Okta on your WorkflowGen instance following the instructions in the Okta authentication section.
Okta configuration
Step 1: Create a native application
Go to the Applications tab in your Okta developer portal, then click the Add Application button.
Choose the Native option, then click Next.
Enter the following information:
Name:
My Native Application
(or the name of your application)Login Redirect URIs: Add your custom redirect URIs here
✏️ Note: Make sure to have checked the Authorization Code option.
Click the Done button.
Step 2: Add a logout redirect URI
Go to the General tab on your Okta native application page, then click the Edit button.
Click the Add URI button next to the Logout redirect URIs property Title.
Enter your custom logout redirect URI in the text field that appears.
Click Save.
Step 3: Add callback URLs
On the Settings tab, scroll down to the Allowed Callback URLs and add the URL workflowgenplus://auth.authorize/okta
.
Review the registration
If you've set up delegated authentication to Okta on your WorkflowGen server, you should have an access policy on your Okta WorkflowGen GraphQL API authorization server that will let any configured client access it. Therefore, there's nothing left to do on the Okta side. Here's a review of the information you need:
A client ID, which can be found on the native application page's Settings tab.
Your Okta domain name, which can be found directly to the left of your profile picture on the top right corner of the page.
All of this information must be given to the users who will be using the mobile application; they'll need to copy them directly into the app.
Okta configuration for server-side scripts
In some cases, you'll want to perform a specific task that can be automated but needs access to the WorkflowGen GraphQL API; this use case is often in the form as a server-side script. For this, OAuth2 provides a type of grant called Client Credentials that simply exchanges a client ID and secret for an access token. There is no ID token since it's not part of the OpenID Connect standard and there's no user involved.
This section provides instructions on how to configure Okta with a server-side script that has access to the GraphQL API. First, you'll need to configure a new web application in the Okta portal; then, you'll need to configure a new application in WorkflowGen.
Prerequisites
Make sure to have a licensed copy of WorkflowGen installed and running on a server.
Make sure to have administrative access to WorkflowGen.
Make sure to have administrative access to Okta to be able to configure it properly.
Make sure to have successfully configured delegated authentication to Okta on your WorkflowGen instance following the instructions in the Okta authentication section.
Okta configuration
In the Applications section in your Okta developer portal, click the Add Application button.
Choose the Service type, then click Next.
Enter the name of your application, then click Done.
Review the registration
Here's a review of the information you need:
A client ID, which can be found on the registered application settings tab.
A client secret, which can be found on the registered application settings tab.
The WorkflowGen GraphQL API identifier, which can be found on its settings page.
WorkflowGen configuration
As with user provisioning, WorkflowGen needs to know which application is accessing the GraphQL API. Therefore, you have to register the application, which consists of your script.
Register a new application
On the Applications page in the WorkflowGen Administration Module, click New application.
Fill in the form:
Name:
My Server Application
Description: A description that clearly identifies the script
Type:
Non-interactive Client
Impersonate username: Any username that has the required access to the GraphQL API
Client ID: The client ID you retrieved earlier
Active: Check this checkbox
Click Save.
Your application should now appear in the list of applications.
You should now have the necessary components in place to make GraphQL API requests with your script by passing the access token received from Okta from a Client Credentials Grant flow.
Okta configuration for single-page applications
JavaScript applications running in a browser are often hard to secure due to the open nature of the Web. Secure storage is nonexistent, and everything is in clear text (for HTTP version 1.1). Here's a quote from the Azure Active Directory team that summarizes the state of authentication with single-page applications:
The OAuth2 implicit grant is notorious for being the grant with the longest list of security concerns in the OAuth2 specification. And yet, that is the approach implemented by ADAL JS and the one we recommend when writing SPA applications. What gives? It’s all a matter of tradeoffs: and as it turns out, the implicit grant is the best approach you can pursue for applications that consume a Web API via JavaScript from a browser.
It's therefore important that you make all of the necessary checks to verify the validity of your requests and the responses.
This section provides instructions on how to configure Okta with a single-page application (SPA) so that users can authenticate through it and make requests to the WorkflowGen GraphQL API. This configuration is done in two steps: registering your SPA, then setting some redirect URLs.
Prerequisites
Make sure to have a licensed copy of WorkflowGen installed and running on a server.
Make sure to have administrative access to Okta to be able to configure it properly.
Make sure to have provisioned an existing Okta user with which you can authenticate to WorkflowGen so that you can use the application afterwards.
Make sure to have successfully configured delegated authentication to Okta on your WorkflowGen instance following the instructions in the Okta authentication section.
Okta configuration
Step 1: Register a new single-page application
On the Applications tab in your Okta developer portal, click the Add Application button.
Choose the Single-Page App type, then click Next.
Enter the following information:
Name:
My SPA
, or the name of your single-page applicationBase URIs: The base URL of your application
Login redirect URIs: The redirect URI for your single-page application
Click Done.
Step 2: Add a logout redirect URI
Go to the General tab on your Okta native application page, then click the Edit button.
Click the Add URI button next to the Logout redirect URIs property Title.
Enter your custom logout redirect URI in the text field that appears.
Click Save.
Review the registration
You need a client ID, which can be found on the General tab on the application page.
Your application should now successfully linked to the Okta infrastructure and users can log in through it. If you have met the prerequisites, your application will receive an access token that it can send to the WorkflowGen GraphQL API to make authorized requests as a Bearer token via the Authorization
header.
Okta configuration for the WorkflowGen CLI
Interactive mode
Create a new native application
Click the Add Application button on the Application tab in your Okta developer portal.
Select the Native option, then click Next.
Enter the following information:
Name:
WorkflowGen CLI
Login redirect URIs: Define the URL as
http://127.0.0.1:8888/callback
✏️ Note: Port
8888
is defined by default; you can change it if it's already in use on your computer.Logout redirect URI: Don't define a URL
Grant Type allowed: Check the Authorization Code and Refresh token checkboxes if they aren't already
Click the Done button.
Review the registration
If you've configured delegated authentication to Okta on your WorkflowGen server, you should have an access policy on your Okta authorization server from the WorkflowGen GraphQL API that will allow all configured users to access it; there's nothing left to do on the Okta side. Here's a summary of the information you'll need:
A client ID, which can be found on the Settings tab on the native application's page.
A metadata URL that consists of the value of
Issuer
and/.well-known/openid-configuration
.✏️ Note: The value of Issuer can be found in the Settings of your Authorization Servers.
All of this information must be given to users who will be using the WorkflowGen CLI.
Non-interactive mode
The configuration of non-interactive mode is the same as in the Okta configuration for server-side scripts section.
Here's a review of the information of the information you'll need:
A client ID, which can be found on the registered application's parameters tab.
A client secret, which can be found on the registered application's parameters tab.
The domain, which can be found on the registered application's parameters tab.
You can now use the WorkflowGen CLI in Client credentials
mode.
Generating a universal link for WorkflowGen Plus
As of WorkflowGen Plus version 1.4.0 and WorkflowGen server version 7.14.0, you can generate a universal link to simplify the Okta login process for your WorkflowGen Plus mobile app users.
Base URL
protocol:
workflowgenplus://
hostname:
auth.init
Parameters
You'll need to specify the following parameters:
provider:
okta
client_id: Use the client ID you created earlier in the configuration (e.g.
0o7gdj4hs92yh7
)domain: The Okta domain name without the URL protocol, whose value must be URL encoded (e.g.
https://dev-958754.oktapreview.com/oauth2/{AUTH_SERVER_ID}/.well-known/openid-configuration%60
)audience: Your WorkflowGen URL, whose value must be URL encoded (e.g.
http://workflow.mycompany.com/wfgen
)
The universal link should follow this format:
Once you've generated the universal link, give it to your users, who can use it to sign in to WorkflowGen Plus with the preset sign-in method.
Additional information on Okta integration
WorkflowGen SOAP API services support
WorkflowGen only supports requests to the SOAP API using classic authentication methods. If you still need to use this API, you have to perform some additional steps to configure it properly.
Create a new separate WorkflowGen directory for the SOAP API users.
Provision it with users and groups as needed.
In the IIS Manager, enable the Basic authentication method for the
\wfgen\ws
application.In the
web.config
file (located in\Inetpub\wwwroot\wfgen
), add the following under<location path="ws" inheritInChildApplications="false">
:
Web service type application support
Web service type applications only support requests using classic authentication methods. If you still need to use these APIs, you have to perform some additional steps to configure it properly.
Make sure you have a local or domain account provisioned on your WorkflowGen server. (This can be the account you used prior to changing your authentication method to Okta.)
In the IIS Manager, enable either the Basic or Windows authentication method for your application (e.g.
wfapps/webservices/myWebService
).In the
web.config
file (located in\Inetpub\wwwroot\wfgen
), add the following new location under the last location:<location path=" wfapps/webservices/myWebService" inheritInChildApplications="false">
The structure should be as follows:
Last updated