Setting up Security for Multiple Sources

A Security Source enables users to log into OnePart using credentials from third-party sources such as SolidWorks Professional PDM, or ActiveDirectory.

This task shows you how to:

Context:

However, if you need to secure documents coming from multiple data source types, you must configure the multisecurity source accordingly. For example, if you have both:

  • An ENOVIA ER and a filesystems source
  • Several Files (filesystem) connectors and a SOLIDWORKS PDM Web API source, etc.

Since OnePart requires users to be signed in, OnePart must always have a security source configured even if there is no need to apply security to files. For details on the default security sources, see About Security

Sample Scenario

This section uses the Files system and SOLIDWORKS PDM Web API connector scenario as an example. The process is the same for other PLM data sources such as ENOVIA.

Context:

In our sample scenario, your documents come from two different types of connectors, each with its own security rules:

  • the first one is based on your SOLIDWORKS PDM instance

  • the second one is based on your filesystem security (LocalWindowsSecurity or ActiveDirectory).

Decide How to Authenticate & Authorize

But when working with multiple security sources, you must specify whether a source is to be used for authentication or not. If not used for authentication, it is treated as an authorization security source. If you only use one security source, it performs both authentication and authorization.

Context:

  • Authentication - is a security source that checks if the user is who they claim to be. This validates the user name and password. You must have at least one authentication security source.
  • Authorization - is a security source thatvchecks if the user is allowed to access this data source, by collecting ACLs for a login. All the other, secondary, security sources can be authorization sources only. A password is optional: if the password specified fails, it is still OK. This is useful for security sources where not all users are present.

How to Retrieve Security Tokens

OnePart multisecurity source provides two ways to retrieve access tokens from authentication when you have multiple authentication sources.

Context:

  • Merge: retrieves the access tokens for all security sources where the user successfully authenticates. This is the most common configuration.

  • First: only retrieves the access tokens from the first security source where the user successfully authenticates. Therefore, this user cannot access documents from any other data source. Typically, you use this configuration when there are several different systems that are mutually exclusive.

Performing a Merge

Context:

When you perform a merge, it:

  • tries to authenticate you on each source that has the Authenticate option checked AND
  • retrieves access tokens for that user from all security sources that have the authorize option checked.

In our example, this means that your users authenticate on PDM-WebApi only, but can see all documents for which they have access in both PDM-WebApi and the File system.

Performing a First

Context:

First authorizes a user on the first security source on which authentication is successful. You define the order of the individual security sources when you add them to the multisecurity source.

In our example, you have a local Windows security source and an SOLIDWORKS PDM Web API security source.

If you enter your Windows user name and password to connect to OnePart when the local Windows security source (app_local) is the authentication source, this is considered as a successful authentication. In this case, the user is not authorized on the SOLIDWORKS PDM Web API security source and so does not have access to SOLIDWORKS PDM documents.

Important: Even if a user’s login and password are identical in both Windows and SolidWorks PDM Web API when using First, the user only has access to documents secured by the first security source where they were authenticated.

Configure the Login Handler

If user logins are different in all the security sources, you must configure login handling. By default, OnePart provides a login handler implementation as a plugin, based on a sample-mapping file, loginHandler.csv

Context:

This csv file provides instructions for how to handle a user’s authentication login for the “non-authenticated” security sources.

Example 1

If you want to be able to use a different login on several sources, here is a loginhandler.csv example:

Context:

ec6,EPDM,admin

Where:

  • ec6 is my login for OnePart

  • EPDM is the name of a security source

  • admin is the login used in the SOLIDWORKS PDM Web API security source (and in my SOLIDWORKS PDM source)

Modify this file for your initial set up, and each time you add a new user to OnePart.

To Configure Login Handling

  1. Go to the \datadir\config folder of your OnePart installation.
  2. Rename loginHandlerSample.csv to loginHandler.csv
  3. Edit this loginHandler.csv configuration file with your required values. For example,
    myWindowsLogin1,EPDM,myEPDMLogin1 myWindowsLogin1,OtherSource,myOtherSourceLogin1 myWindowsLogin2,EPDM,myEPDMLogin2 myWindowsLogin2,OtherSource,myOtherSourceLogin2

    Where: myEPDMLogin(1|2) is the login users enter to log into OnePart myWindowsLogin(1|2) is the user's Windows login.

    Note:

    The Name value must be exactly the same as the target security source (here the local Windows security source).

  4. To activate this login translation, you need to fill in the Login rewriter class of the LWS security source. The value is com.exalead.apps.security.sources.ConfigFileBasedLoginHandler

Configure the Multi-Security Source

Before you begin:

This procedure assumes that you have already done the following:

Context:

The OnePart multi-security source manages all your security sources so users only need to sign in once.

Specify which of these sources are for authentication. The other sources are used for authorization only.

Important: If a source has the option Authenticate selected, then access rights to documents from the associated connector are visible only if you have entered a valid username and password for this security source in the OnePart login page.

To Configure the Security Source

  1. Open the Administration Console.
  2. Go to Search > Security Sources.
  3. Click app_login.
  4. For Type, select how OnePart is to retrieve security tokens; either Merge or First. This value is case-sensitive. See also How to Retrieve Security Tokens.
  5. Forced tokens are used in advanced mode. This field contains security tokens that you want to be added to all connected users.

    Note:

    However, this option can cause security problems. You may add access rights to all users on a given set of documents.

  6. To add a new item, click the Sources section and click Add item.
  7. In Item 2, configure following screen:
    1. Enter EPDM in the Name field to add the SolidWorks PDM Web API security source.
    2. Disable the Authenticate option.
    3. Enter com.exalead.apps.security.ConfigFileBasedLoginHandler in the Login rewriter class field.
  8. Click Apply.

Result: If your login is the same for Windows and PDM, then you are able to sign in to OnePart. You can view documents coming from both the Files (filesystem) connector and the SOLIDWORKS PDM Web API connector.

In this example, the users might have different passwords in the sources: OnePart only checks the Local windows password.

If users have different logins in the different sources, you must specify a Login handler. We provide a default implementation:

com.exalead.apps.onepart.security.ConfigFileBasedLoginHandler

If Authenticate is enabled on both SOLIDWORKS PDM Web API and LWS sources, you cannot see documents from SOLIDWORKS PDM Web API source when your Windows login or password is different from your SOLIDWORKS PDM one.