Skip to main content
AppViewX authenticates to CryptoHub as the endpoint identity from the deployed AppViewX service. Use the method you chose for the endpoint when you deployed the service in Prepare CryptoHub:
  • User name and password (UserPass): AppViewX logs in to the CryptoHub REST API and carries the returned token on every subsequent call.
  • Client certificate (TlsBundle): AppViewX presents the endpoint’s client certificate on every request. It makes no login call and handles no token.
Configure only the method that matches the endpoint. Both methods also require AppViewX to trust the CryptoHub server certificate, as described in Trust the CryptoHub server certificate.

Trust the CryptoHub server certificate

AppViewX connects to CryptoHub over HTTPS and must validate the certificate CryptoHub presents. This is the server certificate of the CryptoHub Dashboard connection, which also serves the REST API. Configure AppViewX as follows:
  • Add the root and any intermediate certificates of the CA that issued the CryptoHub server certificate to the AppViewX trust store for this connection.
  • Connect to CryptoHub with a DNS name that appears in the subject alternative name (SAN) extension of the server certificate. A connection by IP address, or by a name the certificate does not list, fails hostname verification.
The ca-chain.pem file in the endpoint bundle does not validate the CryptoHub server certificate. It holds the CA certificates for the endpoint’s client certificate. Do not use it as the trust anchor for the HTTPS connection.
To view or replace the server certificate, go to Classic Tools > Administration > [ GO TO CONFIGURATION TASKS ] > Network Options > TLS/SSL Settings and select the CryptoHub Dashboard connection. To install a certificate issued by your own CA, with the DNS names AppViewX uses in its SAN extension, see Set up user TLS certificates.

Authenticate with a user name and password

Store the CryptoHub credentials

Store the endpoint username and password in the AppViewX vault so the workflow reads them at run time rather than carrying them inline. The CryptoHub login endpoint expects the password Base64 encoded. Store the encoded value.
Shell
Base64 is an encoding, not encryption. The encoded password is as sensitive as the original. Keep it in the AppViewX vault and out of workflow definitions, exported configuration, and logs.

Configure the authentication call

AppViewX authenticates against /home/v1/login with authType set to userpass.
Request
The response object carries the session token in token and its expiry in tokenExpiration.
The response is similar to the following:
Response
For the full request and response contract, including the other response fields, see Login.
If the identity belongs to a role that requires multiple identities, the session reports fullyLoggedIn: false until enough identities have authenticated. The endpoint identity used for unattended automation should be scoped so that a single login fully authenticates the session.

Carry the token on subsequent calls

Send the token in the Authorization header on each following request:
Shell
Configure AppViewX to read tokenExpiration and re-authenticate when the token expires, rather than assuming a fixed lifetime. For the token handling patterns CryptoHub supports, including the stateless and session-based flows, see Using bearer tokens.
The token lifetime is set by CryptoHub, not by the client. Always honor the tokenExpiration timestamp returned at login rather than a hardcoded lifetime, and re-authenticate when the token expires.

Handle login failure

If authentication fails, the workflow must stop rather than continue to the key generation step. A failed login leaves no CryptoHub objects behind, so no cleanup is required. Verify the following when a login fails:
  • The password is Base64 encoded.
  • The username matches the endpoint identity, not an administrator identity.
  • The endpoint’s partition is enabled.
  • The CryptoHub address resolves and is reachable over HTTPS from the AppViewX host.
  • AppViewX trusts the CryptoHub server certificate. See Trust the CryptoHub server certificate.

Authenticate with a client certificate

With a client certificate endpoint, the TLS client certificate authenticates each request on its own. AppViewX sends no login call, no Authorization header, and no session cookie, and has no token to refresh.

Store the client certificate

Store pki.p12 and the password from pki-password.txt in the AppViewX vault, so the workflow reads them at run time rather than carrying them inline. pki.p12 holds the client certificate CryptoHub issued for the endpoint identity, together with its private key.
pki.p12 contains the private key that authenticates AppViewX to CryptoHub, and pki-password.txt unlocks it. Anyone holding both can act as the endpoint identity. Keep them in the AppViewX vault and out of workflow definitions, exported configuration, and logs.

Configure the HTTPS client

Configure the AppViewX HTTPS connection to CryptoHub to present the certificate and private key from pki.p12 on every request to /home/v1/excrypt. Send the same JSON command bodies as the user name and password method, without an Authorization header.
Request
Use the client certificate from this service’s endpoint bundle. CryptoHub accepts only the certificate it issued for a client certificate endpoint. A certificate CryptoHub did not issue, or one from a user name and password endpoint, is rejected with HTTP 401, even if its subject matches the endpoint identity.

Handle certificate authentication failure

If a request returns HTTP 401, the workflow must stop rather than continue. Verify the following:
  • AppViewX presents the certificate and key from the pki.p12 of a client certificate endpoint of this service.
  • The endpoint’s partition is enabled.
  • The CryptoHub address resolves and is reachable over HTTPS from the AppViewX host.
  • AppViewX trusts the CryptoHub server certificate. See Trust the CryptoHub server certificate.

Next steps

Generate the key pair and certificate signing request. See Generate a key pair and CSR in CryptoHub.