Warning!
This is a legacy document. The features described below are only usable within the classic-generation environment.
Currently, Betty Blocks offers faster and more advanced options that are available in next-gen. Before you start working on some new features in your application, consider doing it using the next-gen version. Good luck!
Webservices enable you to connecting your application with other environments. An authentication key is required for securing these services. This article describes how Client Certificates are used in the Betty Blocks platform for providing authentication.
To set up client certificate, you need to:
Create a model and a property for storing the Client Certificate.
Create a Global Variable for accessing the certificate.
Select the variable as part of the configuration settings.
Create a Model
Create a model for the client certificate. Click on new property (A) to create a property for the certificate. Specify the property Type File (B) to the model. Specify a name (C) for the property. Ensure that the radio button is set to Off (D). Add the client certificate file (E) extension (pfx, pem and crt) and remove file extensions that are not required by clicking on x (F). |
|
|
In the Back office, turn on Builder Mode (E
) and generate a grid for the newly created model. Click + New to open the form, and upload the certificate to the file property. Repeat for all certificates you are using. Make sure no unauthorized people have access to, or the ability to alter these records.
Create a Global Variable
Ok, so we've stored our certificate in the application. Now we only have to access and use it in our process! We're doing this through a variable.ย
Go down to Tools > Variables, and click + New. As our variable kind, we're picking Object
, as we'll use the Certificate object we saved earlier.
Give it an appropriate name, fitting the use case. I'll just call it the same as in the Description property: Docs Certificate
. I'm also using the Description property as my 'identifier'. This means I'll add a filter to the object, where the Certificate object's description needs to be equal to a certain value.
Adjust the filter to your liking, as long as it gets you the Certificate record you need.
The variable will then be available to use in a Configuration!
Create a Client Certificate configuration
Head over to Settings > Configurations, and click + New.
Enter a fitting name for the configuration and choose Client Certificate
as kind.
This will show a new fieldset, containing input fields relevant for you certificate.
Certificate Type: Choose the Certificate Type, be it pem
or pkcs12
.
โCertificate File: This is where our previous efforts come in play. Click the blue variable button to open the Variable browser. All Global variables are available, including the object variable(s) with your Client Certificate! Select the one you need and click on the file property.
โCertificate Password: Pretty straightforward, but important nonetheless. Enter the password/private key provided when the certificate was issued.
Using the Client Certificate
We're done. We set up all everything we needed to use a Client Certificate, now we just need to actually use it.ย
Go to the Webservice of your choice, and choose Client Certificate
as the Authentication Type option. A new option Authentication appears, allowing you to pick the newly created configuration. Save it, give the webservice a go and see if everything works as expected!
In case it doesn't work right away, try the following steps:
Check the certificate's credentials by rebuilding the configuration in e.g. Postman.
Turn on debugging for the action to see if the global variable actually contains a record, and if it does, that it's the correct record.
Reupload the Client Certificate.
Check in with support.