Overview
This document shows a sample configuration for using Okta as an identity provider for Federated Authentication (SSO) for an M-Files Vault.
First, there is a tutorial-like set of instructions for the Okta side, and at the end there is a sample JSON configuration for the vault itself. The configuration of the vault is not different from general OIDC flows, and thus you can change names, add redirects (say, for Mobile apps) or tweak other configuration as needed.
Step 1 - OpenID Connect application in your Okta tenant.
Note that these instructions are valid at the time of compiling them. The UI and settings in Okta may change, so you may need to adjust accordingly.
1 - Creating a new application in Okta
- Go to Applications.
- Select Create New App.
- Select OpenID Connect application and create your application.
- In the application's initial settings, in "Configure OPENID Connect" area, add the login redirect URIs in the new application. In the example below, <Vault FDQN> is the vault specific Fully Qualified Domain Name (FQDN). In other words, it is the address used to access the vault. Add them for both Sign-In and Sign-Out URIs.
- https://<Vault FQDN>/authentication/<configuration name>/read
- https://<Vault FQDN>
- https://<Vault FQDN>/vnext
- http://localhost
Note: These values are case sensitive. Adding the http://localhost redirect URI may result in an error about relative address, in this case you can add the redirect URI in the application later in the application's General settings.
- Leave the Initiate Login URI empty.
- In Federation Broker Mode make sure that Immediate app access with Federation is Enabled.
- Save the new application.
- Note that you may need to add others depending on the configurations and features you use (e.g., add-ins, redirect for Mobile devices).
Some sample settings:
2 - Obtaining the General settings
In the "General Settings" tab make sure that:
- the Client Secret Client Authentication is allowed.
- the grant type "Authorization code" is allowed.
Then, scroll down to "Client Credentials" and
Copy the Client ID and Client Secret values (see Step 2 for where they go in the vault configuration).
Note that the secret must be active.
Example of how the Client ID and Secret may look like in Okta:
3 - Obtaining the Sign On settings
To get the Issuer URL (with which the M-Files server will exchange tokens):
- Go to OpenID Connect Sign on Settings.
- Modifying the default values should not be necessary.
- Scroll down to "OpenID Connect ID Token".
- Copy the Issuer value (see Step 2 for where it goes in the vault configuration).
Note: The Issuer token is required when using JWT tokens for authentication. It may not be required if opaque tokens are used. Generally, using a JWT token is recommended.
The Issuer value should look something like this:
https://<your tenant>.okta.com/oauth2/default
or
https://<your tenant>.okta.com
Note that the URL may differ for your company. If in doubt, contact Okta.
Prefer an OAuth v2 URL if available.
4 - OpenID Connect application Assignments settings
- In the "Assignments" tab, you can assign users who need access to the vault via Okta credentials to the application. Make sure the users and/or groups are correct.
5 - Metadata URL
Your tenant name in Okta defines the URL from which the vault can obtain the rest of the endpoints needed for the configuration, per the OIDC protocol.
Here is how it can look like:
https://<company tenant>.okta.com/oauth2/default/.well-known/openid-configuration
or
https://<company tenant>.okta.com/.well-known/openid-configuration
Note that the metadata URL may differ for your company. If in doubt, contact Okta.
Prefer an OAuth v2 metadata URL if available.
Step 2 - Vault Configuration
There are a few pieces of data you need from the Okta application:
- The application ClientID. It goes in the "Audience" setting under Server settings and in "ClientID" under Client settings in the vault configuration.
- An active application ClientSecret. It goes in the "ClientSecret" setting under Client settings in the vault configuration.
- The Issuer value goes in the "Issuer" Server setting in the vault configuration.
- The Metadata URL. Opening it in the browser should return a JSON configuration. The URL goes in the "IdentityProviderMetadata" setting of the vault.
Notes on other settings you will see in the sample below:
- You can set "EnableLogging" to true under both Client and Server for the initial configuration and monitor the Windows Event Viewer for details and issues on both the client and server. When things are working fine, you should set logging to false for both Client and Server.
- The secondary set of claims and settings ("Audience2", "AccountClaim2", "ForceDownLevelAccountName2") may not be needed for your situation. They are just a way to allow a secondary set of users who get different claims from Okta to use the same configuration to log in - monitoring the logs can show you what data Okta sends for each user and their scopes so you can tweak the configuration as needed - the secondary or primary settings.
- Whether you need to set "ForceDownLevelAccountName" to true or not depends on your Okta tenant and how user names come in in the chosen scope.
- The "AuthorizationEndpoint", "TokenEndpoint" and "LogoutEndpoint" settings should get filled automatically from the metadata URL. If not, you can fill them in manually with values like:
- "AuthorizationEndpoint": "https://<your tenant>.okta.com/oauth2/default/v1/authorize"
- "TokenEndpoint": "https://<your tenant>.okta.com/oauth2/default/v1/token"
- "LogoutEndpoint": https://<your tenant>.okta.com/oauth2/default/v1/logout
Sample JSON configuration - note that you must edit the values before using it:
[
{
"configurations": [
{
"name": "MyOktaAuth",
"assembly": "MFiles.AuthenticationProviders.OAuth",
"oauthSettings": {
"server": {
"IdentityProviderMetadata": "https://<your tenant>.okta.com/oauth2/default/.well-known/openid-configuration",
"Issuer": "https://<your tenant>.okta.com/oauth2/default",
"AccountClaim": "email",
"Audience": "0oa6xjc and more characters",
"AccessTokenType": "JWT",
"EnableLogging": "true",
"Audience2": "api://default",
"AccountClaim2": "sub",
"ForceDownLevelAccountName2": "true"
},
"client": {
"DisplayName": "OKTA",
"ClientID": "0oa6xjc and more characters",
"ClientSecret": "BPGrj3FBb and more characters",
"Scope": "openid profile email",
"Protocol": "OAuth 2.0",
"EnableLogging": "true",
"RedirectOnLoginLoad": "true"
}
},
"tmpProtocol": "oauth"
}
],
"defaultConfiguration": "MyOktaAuth",
"tmpScopeName": "*:Windows"
}
]