Discussions

Eloqua OAuth2 authentication get token URL inaccessible

asht
asht Posts: 2
edited May 20, 2016 1:38PM in Developer Tools

I want to use OAuth2 authentication in my application for calling Eloqua APIs using access token.

I'm following instructions given in the link http://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAB/Developers/GettingStarted/Authentication/authenticate-using-oau… and using Resource Owner Password Credentials grant flow for getting access token.


But I'm getting exception "java.net.ConnectException: Connection timed out: connect" while calling get token endpoint https://login.eloqua.com/auth/oauth2/token from java code.

I tried the endpoint using browser but getting similar error. Also tried accessing the endpoint using REST client but again same connection error.


I'm unable to understand that why the endpoint is giving connection timeout exception. I also tried increasing timeout but same error.

Please guide me as I'm stuck.

Is there any other endpoint for getting Eloqua access token?

Post edited by Unknown User on
Tagged:

Answers

  • Brigitte Li-Oracle
    Brigitte Li-Oracle Posts: 8 Gold Medal
    edited May 20, 2016 1:38PM

    Hey @asht,

    You won't be able to access the endpoint via the browser - you'll see an Eloqua error screen.  The browser makes a GET call to the URL, whereas we need to POST to https://login.eloqua.com/auth/oauth2/token.  I just tested a call to the same endpoint and it worked.

    Just for housekeeping, ensure your app and provider are created with the Eloqua instance where you're hosting the app configuration, and that the request made follows the format per documentation.  If you're still running into issues you may want to reach out to the Support team with details on your app.

    POST https://login.eloqua.com/auth/oauth2/token

    Authorization: Basic <base64 encode of clientid:clientsecret of the app>

    Content-Type: application/json

    {

       "grant_type":"password",

       "scope":"full",

       "username":"testsite\\testuser",

       "password":"user123"

    }