【问题标题】:Atlassian Confluence Webhook not calling Play! method using Atlassian Connect PluginAtlassian Confluence Webhook 没有调用 Play!使用 Atlassian Connect 插件的方法
【发布时间】:2014-02-19 13:50:26
【问题描述】:

我正在尝试使用 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

我不知道什么是 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"
            }
        ]
    }
}

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

这是 Play! 的路由文件中对应 url 的 sn-p:

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 和所有示例的文档,但仍然一无所获。我注意到 webhook 上的 Atlassian Answers 中有许多未解答的问题 - 希望这个问题能得到解答!

【问题讨论】:

    标签: playframework-2.0 confluence atlassian-connect


    【解决方案1】:

    戏剧! app 的方法从未被调用,因为它受到自己的身份验证机制的保护,即该方法具有注释 @Security.Authenticated(Secured.class)

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-08-24
      • 2018-09-19
      • 1970-01-01
      • 2020-11-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多