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

Access to the full request object returned from getToken(...) #439

Open
ZacharyDuBois opened this issue Feb 16, 2024 · 0 comments
Open

Access to the full request object returned from getToken(...) #439

ZacharyDuBois opened this issue Feb 16, 2024 · 0 comments

Comments

@ZacharyDuBois
Copy link

Context

  • node version: v21.6.1
  • module version: ^5.0.0
  • environment (e.g. node, browser, native): node
  • any other relevant information:

What problem are you trying to solve?

Access full request object from .getToken() call. Acumatica has a pretty messed up OAuth flow to where you get a session id as a Cookie on the token request. You need to get this so you can later log out the session as required by their licensing. Sadly they do not track it by access tokens.

I understand this is pretty specific to one platform's bad implementation of OAuth (and API's in general). But I could see other uses for getting full response data returned.

Do you have a new or modified API suggestion to solve the problem?

Right now, I have extended a few classes to have the Client.request(...) return the full response object. Then modified the ResourceOwnerPassword.getToken() to stitch the Set-Cookie header into the AccessToken object. A bit messy but it worked.

Their API has been an absolute PITA. 500 is really a 404...etc. Bad practices all over.

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