Jira Cloud Connect App "Spring Boot App" Missing shared secret

this is my descriptor

{
  "key": "${addon.key}",
  "baseUrl": "https://eae8-105-104-99-29.ngrok-free.app",
  "name": "Fields Cloud",
  "description": "This plugin will allow you to create new type of custom field",
  "apiVersion": 1,
  "enableLicensing": true,
  "vendor": {
    "name": "Technologies",
    "url": "https://www.technologies.com/"
  },
  "authentication": {
    "type": "jwt"
  },
  "lifecycle": {
    "installed": "/api/v1/lifecycle/installed",
    "uninstalled": "/uninstalled"
  },
  "scopes": [
    "READ",
    "ADMIN"
  ],
  "modules": {
    "generalPages": [
      {
        "key": "sql-cf-config-page",
        "location": "system.top.navigation.bar",
        "name": {
          "value": " Custom Field Config",
          "i18n": "generalPages.sql-cf-config-page.name"
        },
        "conditions": [
          {
            "condition": "user_is_admin"
          }
        ],
        "url": "-cloud-config"
      }
    ],
    "webPanels": [
      {
        "key": "cloud-section",
        "location": "atl.jira.view.issue.left.context",
        "name": {
          "value": "Fields Section",
          "i18n": "webPanels.sql-cf-cloud-section.name"
        },
        "url": "/fields"
      }
    ]
  }
}

i am missing the shared secret in the response Body .

Hi @SALAHAbderraouf,

Welcome to the community!

The shared secret is not a part of the app descriptor but is data that is shared using the lifecycle events. These events are send to your app when an admin (un)installs your app on there Jira Cloud instance.
See also the docs on this Multitenancy in Connect

Cheers,
Mark

1 Like

Hello;
I know that the shared secret is not part of the app descriptor. What I meant is that as soon as I install the plugin, I do not get the shared secret, which is important in the management of JWT.
This is the response from the Chrome Network Response after the installation process

{
    "links": {
        "self": "/rest/plugins/1.0/SqlCustomFieldCloud-key",
        "plugin-summary": "/rest/plugins/1.0/SqlCustomFieldCloud-key/summary",
        "plugin-icon": "/rest/plugins/1.0/SqlCustomFieldCloud-key/media/plugin-icon",
        "plugin-logo": "/rest/plugins/1.0/SqlCustomFieldCloud-key/media/plugin-logo",
        "manage": "https://salah16.atlassian.net/plugins/servlet/upm?fragment=manage%2FSqlCustomFieldCloud",
        "delete": "/rest/plugins/1.0/SqlCustomFieldCloud-key"
    },
    "key": "SqlCustomFieldCloud",
    "enabled": true,
    "enabledByDefault": true,
    "version": "1.0",
    "description": "This plugin will allow you to create new type of custom field. SQL custom field has different type: Autocomplete, select, table, checkbox and radio buttons.",
    "name": "Kepler - SQL Query Fields Cloud",
    "modules": [],
    "userInstalled": true,
    "optional": true,
    "unrecognisedModuleTypes": false,
    "unloadable": false,
    "static": false,
    "usesLicensing": true,
    "remotable": true,
    "vendor": {
        "name": "Kepler Technologies Algérie",
        "marketplaceLink": "https://www.kepler-technologies.com/",
        "link": "https://www.kepler-technologies.com/"
    }
}

Hi @SALAHAbderraouf,

Not sure how you are using the Chrome Network Response in the installation flow, but to my knowledge the lifecycle events are only shared with your app using the lifecycle endpoints configured in the app descriptor. They are never shared with the user that managing the app.

Looking at your descriptor you should see a request come in on https://eae8-105-104-99-29.ngrok-free.app/api/v1/lifecycle/installed with the app installed lifecycle event.

By using ngrok, you should see this being logged in the console of the ngrok client if you start the ngrok tunnel using a separate console process.

You may also want to look at the app logs for the package com.atlassian.connect.spring.internal.lifecycle This is where the LifecycleController lives and it does log when it received install and uninstall events.

Cheers,
Mark

1 Like

Thank you for your prompt response, i asked this question because i got this from the official documentation here :
Your app should have an endpoint at /installed and expect data to be POSTed to it. Here’s is an example of the data object that will be sent:

{
  "key": "installed-addon-key",
  "clientKey": "unique-client-identifier",
  "sharedSecret": "a-secret-key-not-to-be-lost",
  "serverVersion": "server-version",
  "pluginsVersion": "version-of-connect",
  "baseUrl": "https://example.atlassian.net",
  "displayUrl": "https://docs.example.com",
  "productType": "jira",
  "description": "Atlassian Jira at https://example.atlassian.net",
  "serviceEntitlementNumber": "SEN-number",
  "eventType": "installed"
}

When you receive this data, save it to your persistent data store and index against the clientKey as the unique identifier.

in my case i cannot see “sharedSecret”: “a-secret-key-not-to-be-lost”, attribute in the received JSON
Kind regards

Hi @SALAHAbderraouf

First off happy new year!

Second, what authentication setting you do you have in your descriptor?
I think this requires to be set to jwt in order to get the sharedSecret in the event payload.

add this to your descriptor of you don’t have authentication set

"authentication": {
  "type": "jwt"
}

Hi @markrekveld
Happy New Year to you too! :tada:

Thank you for your prompt response and suggestion. I appreciate your help.
Regarding your question, I’ve already set the authentication type in my app descriptor to “jwt.” Here’s a snippet for your reference: “authentication”: {
“type”: “jwt”
} i would like to retrieve this sharedSecret

Hi @SALAHAbderraouf

You may need to uninstall and reinstall the app.
The shared secret is not send in the event body when authentication is not set or set to none in the app descriptor.

If you change this from none/missing to jwt that you need to uninstall & reinstall the app so that your app will get the new lifecycle event body which should include the shared secret in the event body.

If you are still having issues then maybe from someone from Atlassian can pitch in. @ibuchanan do you have any ideas?

1 Like

@SALAHAbderraouf,

I don’t have better ideas than @markrekveld. Like his advice, I suspected the authentication module. What would really help is posting a bit more about what you are trying to accomplish and what you have tried. Otherwise, the only thing I can say is the very useless, “It works for me.”