Create Dialog is not sending clientKey information while creating a blueprint

Hi Experts,

I am trying to create a blueprint page in Confluence Cloud. There is no information about the clientKey, clientInfo in “req” sent by Create Dialog. Also no ‘lic’ information in the query, this is stopping us to get the licensing information of the customer. Code is from standard blueprint example for confluence cloud. I haven’t seen any threads regarding this so creating one.

Please help if I am missing anything here.

{
    "key": "blueprint-key-confluence-cloud",
    "name": "Blueprint for Atlassian Cloud",
    "description": "Creates a Blueprint",
    "vendor": {
        "name": "Company Name",
        "url": "Company URL"
    },
    "baseUrl": "{{localBaseUrl}}",
    "links": {
        "self": "{{localBaseUrl}}/atlassian-connect.json",
        "homepage": "{{localBaseUrl}}/atlassian-connect.json"
    },
    "authentication": {
        "type": "jwt"
    },
    "lifecycle": {
        "installed": "/installed"
    },
    "scopes": [
        "READ",
        "WRITE"
    ],
    "modules": {
        "blueprints": [
            {
                "template": {
                    "url": "/blueprint.xml"
                },
                "createResult": "edit",
                "key": "desktop-blueprint",
                "name": {
                    "value": "Desktop blueprint"
                }
            }
        ]
    }
}

module.exports = function (app, addon) {

    // Root route. This route will serve the `atlassian-connect.json` unless the
    // documentation url inside `atlassian-connect.json` is set
    app.get('/', function (req, res) {
        res.format({
            // If the request content-type is text-html, it will decide which to serve up
            'text/html': function () {
                res.redirect('/atlassian-connect.json');
            },
            // This logic is here to make sure that the `atlassian-connect.json` is always
            // served up when requested by the host
            'application/json': function () {
                res.redirect('/atlassian-connect.json');
            }
        });
    });

    // Serve blueprint template
	
    app.get('/blueprint.xml', function (req, res) {
		console.log(req);
        res.set('Content-Type', 'text/xml');
        res.send(fs.readFileSync('./blueprint.xml'));
    });
  

};

following is req log I see.

body: {},
  secret: undefined,
  cookies: [Object: null prototype] {},
  signedCookies: [Object: null prototype] {},
  context: {
    http: null,
    title: 'Blueprint for Atlassian Cloud',
    addonKey: 'blueprint-key-confluence-cloud',
    clientKey: '',
    token: '',
    license: undefined,
    localBaseUrl: 'https://762880605966.ngrok.io/',
    hostBaseUrl: '',
    hostUrl: '',
    hostStylesheetUrl: '/atlassian-connect/all-debug.css',
    hostScriptUrl: 'https://connect-cdn.atl-paas.net/all.js'
  },

Thanks in advance!

Best regards,
Pavan G

We tried a workaround using webhooks for getting license information, but this will generate lot of load to the server. Every time user opens a Create Dialog or refreshes the page we are getting /search_performed?lic=Active (or none) in the query depending on the license information.

Please suggest.

"modules": {
	
		"webhooks":[
			{
			"event":"search_performed",
			"url":"search_performed"
			}
		],
		"blueprints": [
            {
			    "template": {
                    "url": "/blueprint.xml"
                },  ...

in index.js

app.post('/search_performed',function (req, res)
	{
		var licenseText = req.query['lic'];
		console.log(licenseText);
	});

Thanks in advance!

Best regards,
Pavan G

Atlassian Experts!

@Kantega, @LaCapitale, @Amber, @Ixperta

This is a critical issue. Please respond.
I am not sure how to get to you attention.

@danielwester banking on you :grinning:

Thanks!
Best regards,
Pavan G

Since you’re using ngrok in the descriptor - are you still in development? If so - I don’t think you’ll get the lic param until you create a private entry on the marketplace (with your ngrok url) and then do a private token installation: https://developer.atlassian.com/platform/marketplace/installing-cloud-apps/

Not sure though that the blueprint xml will get that parameter though - I think that’s static in nature.

@rwhitbeck ?

/Daniel

Thanks for your Quick response @danielwester!!

We tried this on our private listing without ngrok ( test server ) …

I am coming back to Atlassian experts after spending dozens of hours. Appreciate if you can pull in right resources to look into this.

:bowing_man:

Thanks!

Best regards,
Pavan G

Don’t really have anything to tell you(should note that I’m not Confluence Connect is not my normal area nowadays). I think your issue is that the blueprint xml is by design to be static (is not anonymous). If you’re trying to make it adapted to a per client basis - it’s probably not going to work.

Thanks @danielwester for your quick responses!

@rwhitbeck

As per Atlassian documentation for every request, response Lic information is sent in query parameter, else we can also use Rest API to get the licensing information.

https://developer.atlassian.com/platform/marketplace/cloud-app-licensing/

We are unable to get handle to httpClient as clientKey information is not sent and http: null in the context.

context: {
    http: null,
    title: 'Blueprint for Atlassian Cloud',
    addonKey: 'blueprint-key-confluence-cloud',
    clientKey: '',
    token: '',

We have a workaround by inserting a webhook in the blueprint module, where we are getting ‘lic’ information, but this will increase the load on the server.

Is there something that we are missing?

Thanks in advance!

Pavan G