Search code examples
jiraatlassian-connect

Atlassian Connect Express: Credentials rejected at connect-ace.atlassian.net


I'm evaluating atlassian-connect-express and just created an app boilerplate with "atlassian-connect new", and then deployed it via ngrok to my Jira dev account.

That works fine, but when I try to use the file "credentials.json" with my account data, the plug starts with the error message:

Failed to register with host https‍://michael%40...:[My password]@connect-ace.atlassian.net (401)
Add-on not registered; no compatible hosts detected

I get a similar message when I go to the url connect-ace.atlassian.net

Here my atlassian-connect.json

{
    "key": "my-add-on",
    "name": "Ping Pong",
    "description": "My very first add-on",
    "vendor": {
        "name": "Angry Nerds",
        "url": "https://www.atlassian.com/angrynerds"
    },
    "baseUrl": "https://xxxxxxx.ngrok.io",
    "links": {
        "self": "https://xxxxxxxx.ngrok.io/atlassian-connect.json",
        "homepage": "https://xxxxxxx.ngrok.io/atlassian-connect.json"
    },
    "authentication": {
        "type": "jwt"
    },
    "lifecycle": {
        "installed": "/installed"
    },
    "scopes": [
        "READ"
    ],
    "modules": {
        "generalPages": [
            {
                "key": "hello-world-page-jira",
                "location": "system.top.navigation.bar",
                "name": {
                    "value": "Hello World"
                },
                "url": "/hello-world",
                "conditions": [{
                    "condition": "user_is_logged_in"
                }]
            },
            {
                "key": "hello-world-page-confluence",
                "location": "system.header/left",
                "name": {
                    "value": "Hello World"
                },
                "url": "/hello-world",
                "conditions": [{
                    "condition": "user_is_logged_in"
                }]
            }
        ]
    }
}

and my credatials.json

{
    "hosts": {
        "connect-ace.atlassian.net": {
            "product": "jira",
            "username": "michael@---",
            "password": "---password---"
        }
    }
}

How can I get my dev account working with connect-ace?


Solution

  • Two things to check:

    1 - Check the if the credentials.json has correct values. host url should start with https://. Password is the api token generated from here.

    {
        "hosts": {
            "https://<your atlassian site name>.atlassian.net": {
                "product": "jira",
                "username": "<jira user name>",
                "password": "<Token created from https://id.atlassian.com/manage/api-tokens>"
            }
        }
    }
    

    2- Enable development mode at Settings -> Apps -> Manage Apps -> Settings. (This is required if the app is not published in marketplace)

    enter image description here