-
Notifications
You must be signed in to change notification settings - Fork 17
Authentication Methods
DeepLynx secures its HTTP endpoints in a few different ways. Below is a brief overview of DeepLynx's security measures. These measures are configured using environment variables - see the .env-sample
file for more information.
It is highly recommended that you only enable Basic Authentication for local development purposes. There is no way to track individual users or to implement access control using this method. All methods and routes will be accessible to anyone possessing the proper username and password. Basic authentication is not considered a secure production method.
- Set
AUTH_STRATEGY
environment variable tobasic
(either using the.env
file or the deployment target's own environment) - Set
BASIC_USER
andBASIC_PASSWORD
to desired values
Token authentication relies on the user submitting a JSON Web Token with each request. Said JWT is retrieved by using one of the authentication methods below. Once a user is authenticated and a JWT has been retrieved, subsequent requests against DeepLynx must be sent with an Authorization
header with the JWT as a bearer token.
- Set
AUTH_STRATEGY
environment variable totoken
(either using the.env
file or the deployment target's own environment) - Set all required environment variables for
token
- namely the environment variables for the encryption key path or secret and SAML variables (if using SAML).
In order to enable SAML authentication for active directory federation services, the application will need access to a self signed certificate private key (certificate must be previously registered), and the x509 certificate for SAML authentication located in the ADFS's metadata document. Instructions for acquiring each are below.
-
Self-signed certificate private key: There are a few methods by which you can accomplish this. First, you could use OpenSSL to generate a certificate and its private key at the same time - this is probably the easiest way and I've included a bash script (
src/authentication/generate-cert.sh
) which will do this for you on *nix based systems. If you are on Windows, you could also use OpenSSL or you can use the PowerShell scriptCertsDeLynx.ps1
'sGet-Self-Cert-Key
function. Note: you must still export the private key using Windows certificate management tools yourself. -
x509 Certificate from ADFS Metadata: In order to verify your identity provider's responses you must have access to their public x509 certificate. Most ADFS services provide a HTTP endpoint serving a
metadata.xml
document which will contain the x509 certificate for SAML 2.0 authentication services. In order to facilitate the retrieval of this key I've included both a bash script (get-adfs-cert
) and a PowerShell function (CertDeLynx.ps1
'sGet-Cert-From-Idp
) to help you retrieve it. The certificate will be saved to a.crt
file.
Quick example of the PowerShell script
$FederationMetatdataUrl = "adfs metadata url"
.\CertsDeLynx.ps1; Get-Cert-From-IdP ((new-object System.Net.WebClient).DownloadString($FederationMetadataUrl))
Once you have those two pieces you're ready to configure the application.
- Set
AUTH_STRATEGY
environment variable totoken
(either using the.env
file or the deployment targets own environment, applies to all environment variables listed after this step) - Set
SAML_ADFS_ISSUER
to the application id assigned when you registered this application with the ADFS service - Set
SAML_ADFS_CALLBACK
to the URL the Identity Provider will send the user to after a successful authentication (this is generally registered with the Identity Provider beforehand) - Set
SAML_ADFS_PRIVATE_CERT_PATH
to the absolute path for your self-signed certificate's private key - Set
SAML_ADFS_PUBLIC_CERT_PATH
to the downloaded x509 certificate from the ADFS metadata document
Note: This document assumes that you have configured the Identity Provider service correctly. It is out of scope to provide information on how to do that here. Contact your Active Directory systems administrator if you need help or information on this subject.
Note: This form of authentication does not currently integrate with any of the internal authentication methods related to users or containers.
SecurID is an identity and access management provider. Users provide a memorized pin and temporary 6 digit token to authenticate with the RSA server. These two tokens combined (pin + temporary token with no spaces or other characters between) creates the securID. This form of authentication is currently intended for use when integrating DeepLynx with certain environments and processes, such as a High Performance Computing center that shares the same RSA SecurID system and can validate the provided credentials.
To get set up for integration with RSA, please set the following config parameters:
-
RSA_URL
: The full url (including port) to the RSA server -
RSA_CLIENT_KEY
: A key generated by the RSA server owner and provided to the client (this DeepLynx application) for authenticating the client -
RSA_CLIENT_ID
: A client ID for the DeepLynx application provided by the RSA server owner
There are two possible authentication flows:
- Call the
initialize
route with the user's id (subjectName
) - Call the
verify
route with the user'ssecurID
,inResponseTo
(the message ID generated by the RSA server and included in the previousinitialize
request response), andauthnAttemptId
(an ID generated by the RSA server and included in the previousinitialize
request response).
Or,
- Call the
initialize
route with both the user's id (subjectName
) andsecurID
. This will perform the authentication request and return the result, makingverify
unnecessary.
Additionally, the status
route may be used to check the status of the authentication request and the cancel
route will cancel an authentication attempt.
For full details, see the official RSA Guide
Sections marked with ! are in progress.
- HTTP Authentication Methods
- Generating and Exchanging API Keys for Tokens
- Creating a DeepLynx Enabled OAuth2 App
- Authentication with DeepLynx Enabled OAuth2 App
- Creating an Ontology
- Creating Relationships and Relationship Pairs
- Ontology Versioning
- Ontology Inheritance
- Querying Tabular (Timeseries) Data
- Timeseries Quick Start
- Timeseries Data Source
- Timeseries Data Source via API
- Exporting Data
- Querying Data
- Querying Timeseries Data
- Querying Jazz Data
- Querying Data - Legacy
- Querying Tabular Data