Atlassian Confluence Webhook没有调用Play!使用Atlassian Connect Plugin的方法

问题描述 投票:2回答:1

我正在尝试使用webhook(登录事件)来打电话给我的Play!应用程序。我需要将该用户的用户和IP地址传递给该方法,但是我收到此错误:

[httpclient-callbacks:thread-37]          
[atlassian.webhooks.plugin.PublishTaskFactoryImpl$PublishTaskImpl] apply Unable to post the information to http://<host>:9000/geoip/login due to null

我不知道什么是空的,没有足够的文件来弄清楚为什么?请帮忙。

atlassian-connect.json

{
    "baseUrl": "${localBaseUrl}",
    "key": "confluence-webhook",
    "authentication": {
        "type": "jwt"
    },
    "vendor": {
        "name": "Wikistrat",
        "url": "http://www.wikistrat.com"
    },
    "description": "Atlassian Connect add-on that connects to GeoIP2",
    "name": "GeoIP2",
    "lifecycle": {
        "installed": "/installed",
        "uninstalled": "/uninstalled"
    },
    "scopes": [ "READ", "WRITE" ],
    "modules": {
        "webhooks": [
            {    
         "key": "confluence-webhook",
                 "event": "login",
                 "url": "geoip/login"
            }
        ]
    }
}

我已经对params进行了硬编码,因为我不知道如何包含变量。

这是Play!的路径文件中与网址对应的片段:

POST /geoip/login controllers.GeoIp.getLocation()

getLocation()方法读取参数并完成它的东西。

登录Confluence时我会在...\Atlassian Run Standalone\amps-standalone\target\confluence-LATEST.log中收到此错误(应触发webhook):

2014-02-19 13:21:11,175 WARN [httpclient-callbacks:thread-29]   
[atlassian.webhooks.plugin.PublishTaskFactoryImpl$PublishTaskImpl] apply Unable to post the information to http://<host>:9000/geoip/login due to null

我有运行节点app.js(端口3000),它产生这个输出:

login
{    timestamp: 1392816071138,
     remoteIP: '0:0:0:0:0:0:0:1',
     user: 'savbalac',
     remoteHost: '0:0:0:0:0:0:0:1' }
POST /login 204 37ms

这在confluence-latest.log

2014-02-19 13:21:11,176 WARN [httpclient-callbacks:thread-29] 
[atlassian.webhooks.plugin.PublishTaskFactoryImpl$PublishTaskImpl] apply Unable to post the information to http://<host>:3000/login due to null

我打开了管理页面中的所有日志记录,我已经阅读了Webhooks和所有样本的文档,但仍然无处可去。我注意到在webhooks上的Atlassian Answers中有许多未解答的问题 - 希望这个问题会得到一个!

playframework-2.0 confluence atlassian-connect
1个回答
2
投票

表演!应用程序的方法从未被调用,因为它受其自身的身份验证机制保护,即该方法具有注释@Security.Authenticated(Secured.class)

来自Confluence的请求需要JWT身份验证。

© www.soinside.com 2019 - 2024. All rights reserved.