0

I'm trying to connect to Quickbooks Online's API from inside a SQL stored procedure, and was wondering if it's possible to do something like this right here but also pass in OAuth2.0 credentials (things like , Refresh Token, Access Token, redirect URI, client secret).

Ex. with QBO's API. I know the URL link is https://sandbox-quickbooks.api.intuit.com/v3/company//account/1?minorversion=14

But this request will always fail with error 401 - authorization. How could I pass the OAuth credentials in so that does not happen?

Thanks, and please let me know if this is better suited for elsewhere.

alrightaaa
  • 29
  • 5
  • Build your own CLR functions/procedures. Don't use those archaic procedures; they're more for compatibility with really old databases (such as those from SQL Server 2000). – Thom A Aug 24 '21 at 13:17
  • Avoid using sp_OA* procs: they aren't thread-safe, they leak resources like a sieve when not handled properly, and they're Windows-specific. CLR functions/procedures are an improvement, but interacting with web APIs really doesn't belong inside a database and should be handled by external processes. Also refresh_tokens can't be used for API access, they're only for renewing expired access_tokens. Try reading up on JWTs and [IdentityServer4](https://docs.identityserver.io/en/latest/intro/big_picture.html) to get a better understanding of how OpenID Connect and OAuth2 mechanisms work. – AlwaysLearning Aug 24 '21 at 13:36
  • duplicate of [your previous post from different account](https://stackoverflow.com/questions/68886532/connecting-to-quickbooks-online-from-sql-script-directly-passing-in-oauth2) – SMor Aug 24 '21 at 14:28

1 Answers1

0

Use an OAuth Client Library in your preferred language.

If you use a language that IntuitDeveloper does not have a client library for, you will need to create your own OAuth Flow.

Stephen Stilwell
  • 518
  • 1
  • 5
  • 17