GET /api/apps/versions/{AppVersionID}/secret

Returns the Shared Secret for the app version. Valid if the Shared Secret is stored on the platform. Not valid for apps that have a user-defined app identity referencing an external identity domain.

This operation uses the Java API of the underlying infrastructure, Policy Manager, to get the shared secret.

Note: If the app has a user-defined App Identity that includes a domain, the platform does not collect, regenerate, return, or display the Shared Secret value. Instead, the user manages the app's Shared Secret in the external identity domain, which must be a valid domain set up in the platform. The platform takes the Shared Secret value that the user provides and validates it with the external identity domain. In these scenarios, this operation cannot retrieve the app's shared secret.

In versions of the platform prior to 7.1.0, this operation returns the plain text Shared Secret. In version 7.1.0 or later, it returns one of the following:

  • If the platform is set to return shared secret in plain text: the response includes:
    • Shared Secret property: the app's shared secret in plain text
    • Assigned property: not included (for backwards compatibility)
  • If the platform is set to return encrypted shared secret, and the app's certificate/CSR has been uploaded to the platform:
    • EncryptedSharedSecret property: the app's shared secret, encrypted with the app's public key.
    • SharedSecret property: Not returned as plaintext shared secret should not be included in the response.
    • Assigned property: value is Available.
  • If the platform is set to return encrypted shared secret, and the app's certificate/CSR has not been uploaded to the platform: the shared secret is not returned, either in plain text or encrypted. The app team member must contact the Administrator for the shared secret.

    Note: If the app identity is a platform identity, the platform’s Policy Manager SOAP service provides a way for a user with System Administrator credentials to retrieve the password of the identity. The Administrator might have other tools to retrieve the password from the database. When an app uses the platform internal identity, the app's Shared Secret is the app identity’s password.

Authorization Roles/Permissions: App team member, Business Admin, or Site Admin.

This topic includes the following sections:

HTTP Method

GET

URL

https://{hostname}/api/apps/versions/{AppVersionID}/secret

Sample Request

The example below shows a successful call to this operation.

Sample request URL

https://{hostname}/api/apps/versions/9CA3Avaz8e96zMUKhaL4mM4s.acmepaymentscorp/secret

Sample request headers

GET /api/apps/versions/9CA3Avaz8e96zMUKhaL4mM4s.acmepaymentscorp/secret HTTP/1.1
Host:{hostname}
Accept: application/json, text/javascript, */*; q=0.01
X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body

Not applicable.

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept application/json, application/vnd.soa.v71+json, application/vnd.soa.v72+json, application/vnd.soa.v80+json, application/vnd.soa.v81+json
Cookie AtmoAuthToken_{fedmemberid}={cookie value, which usually starts with TokenID}—The platform cookie. This is the Akana API Platform authorization token, and must be sent with every API request that requires login. For more information and an example, see Session cookies.
X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login.

Request Parameters

Parameter Parm Type Data Type Required Description
AppVersionID Path string Required The unique ID for a specific app version.

Response

If successful, this operation returns HTTP status code 200, with a JSON object containing the shared secret information.

Sample Response

The sample response below shows successful completion of this operation when the platform is configured to allow retrieval of the shared secret in plain text.

Sample response headers

HTTP/1.1 200 OK
Date: Thu, 28 Jun 2018 03:56:37 GMT
Content-Type: application/json

Sample response body

{
  "SharedSecret" : "22325ce7187b0d2c9324cd56aadbeb105c308d9b43a6a1a01935e7da4f2a4c85"
}

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type application/json, application/vnd.soa.v71+json, application/vnd.soa.v72+json, application/vnd.soa.v80+json, application/vnd.soa.v81+json

Response Body

Name Type Description
SharedSecret SharedSecret Includes encrypted information about an app's Shared Secret value, in JSON format, if the Shared Secret is stored on the platform. Not valid for apps that have a user-defined app identity referencing an external identity domain.

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
401 Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. You would also get this response for any operation that requires login (almost all) if the login cookie was missing.
404 The resource could not be found.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.