Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oauthd not supporting xml response for get access token call. #183

Open
vinodjoseph62 opened this issue Jun 1, 2016 · 0 comments
Open

Comments

@vinodjoseph62
Copy link

vinodjoseph62 commented Jun 1, 2016

I am trying to add oauth support for Concur . This provider gives a xml response for get access token call, but currently our oauth-response-parser supports json and url encoded formats. I am passing the format parameter in the concur's conf file. The response from concur is in this format

<Access_Token>
  <Instance_Url>https://www.concursolutions.com/</Instance_Url>
  <Token>*********access token********</Token>
  <Expiration_date>6/1/2017 2:24:46 PM</Expiration_date>
  <Refresh_Token>*******My Refresh token*****</Refresh_Token>
</Access_Token>

But after the providers gives a response in xml format oauthd gives the following error

{
  "body": {
    "<Access_Token>\r\n  <Instance_Url>https://www.concursolutions.com/</Instance_Url>\r\n  <Token>myAccessToken": "</Token>\r\n  <Expiration_date>6/1/2017 12:46:52 PM</Expiration_date>\r\n  <Refresh_Token>myRefreshToken</Refresh_Token>\r\n</Access_Token>",
    "stack": [
      "Error: Error during the 'access_token' step (access_token not found)",
      "    at OAuth2ResponseParser.OAuthResponseParser._setError (/usr/local/lib/node_modules/oauthd/bin/core/oauth/oauth-response-parser.js:97:20)",
      "    at /usr/local/lib/node_modules/oauthd/bin/core/oauth/oauth2-response-parser.js:48:35",
      "    at /usr/local/lib/node_modules/oauthd/bin/core/oauth/oauth-response-parser.js:53:18",
      "    at OAuth2ResponseParser.OAuthResponseParser.decode (/usr/local/lib/node_modules/oauthd/bin/core/oauth/oauth-response-parser.js:23:16)",
      "    at OAuth2ResponseParser.OAuthResponseParser.parse (/usr/local/lib/node_modules/oauthd/bin/core/oauth/oauth-response-parser.js:28:19)",
      "    at OAuth2ResponseParser.parse (/usr/local/lib/node_modules/oauthd/bin/core/oauth/oauth2-response-parser.js:38:51)",
      "    at Request._callback (/usr/local/lib/node_modules/oauthd/bin/core/oauth/oauth2.js:82:33)",
      "    at Request.self.callback (/usr/local/lib/node_modules/oauthd/node_modules/request/request.js:198:22)",
      "    at emitTwo (events.js:87:13)",
      "    at Request.emit (events.js:172:7)"
    ]
  }
}

Is there any way to solve this by parsing the xml, any solution to get access token for concur using oauthd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant