【问题标题】:Eloqua OAuth2 authentication get token URL inaccessibleEloqua OAuth2 身份验证获取令牌 URL 无法访问
【发布时间】:2016-09-15 00:59:36
【问题描述】:

我想在我的应用程序中使用 OAuth2 身份验证来使用访问令牌调用 Eloqua API。

我正在按照链接 http://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAB/Developers/GettingStarted/Authentication/authenticate-using-oau... 中的说明进行操作,并使用 资源所有者密码凭据授予流程 获取访问令牌。

POST https://login.eloqua.com/auth/oauth2/token
Authorization: Basic Q09NUEFOWVhcdXNlcjE6cGFzc3dvcmQxMjM=
{
   "grant_type":"password",
   "scope":"full",
   "username":"testsite\\testuser",
   "password":"user123"
}

但我在从 java 代码调用获取令牌端点 https://login.eloqua.com/auth/oauth2/token 时遇到异常“java.net.ConnectException: Connection timed out: connect”。

我使用浏览器尝试了端点,但遇到了类似的错误。还尝试使用 REST 客户端访问端点,但再次出现相同的连接错误。

我无法理解为什么端点会给出连接超时异常。我也尝试增加超时但同样的错误。

当我遇到困难时请指导我。

是否有任何其他端点可以获取 Eloqua 访问令牌?

【问题讨论】:

  • 如果无法访问,请咨询 Eloqua 服务提供商

标签: oauth-2.0 eloqua


【解决方案1】:

以下是邮递员屏幕截图,以防万一。 也写出来以防有一天屏幕截图不存在。不要在 POSTMAN 中使用内置的 Auth,因为您需要对 clientid:clientsecret 进行 base64 编码,中间带有 :。这些值是您在 Eloqua 中创建应用程序时提供的。

请务必将内容类型包括为 application/json 和 Authorization。在 Json 中为站点和用户名 (clientsite\\username) 之间的用户名使用双反斜杠。

JSON 正文应如下所示: {"grant_type":"password","username":"clientsite\\username","password":"password"}

【讨论】:

    【解决方案2】:

    确保你正在做一个POST 到login.eloqua.com/auth/oauth2/token

    来自文档:

    POST https://login.eloqua.com/auth/oauth2/token
    Authorization: Basic Q09NUEFOWVhcdXNlcjE6cGFzc3dvcmQxMjM=
    {
       "grant_type":"authorization_code",
       "code":"SplxlOBeZQQYbYS6WxSbIA",
       "redirect_uri":"https://client.example.com/cb"
    }
    

    根据您的请求,您似乎缺少 redirect_uri 和 代码。 尝试使用文档中的正文契约:http://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAB/index.html#Developers/GettingStarted/Authentication/authenticate-using-oauth.htm

    【讨论】:

    • 我已将我的请求添加到 Eloqua
    猜你喜欢
    • 2018-09-07
    • 1970-01-01
    • 2015-11-02
    • 2015-06-21
    • 2022-09-28
    • 1970-01-01
    • 2018-08-27
    • 2016-12-07
    • 1970-01-01
    相关资源
    最近更新 更多