Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 81abcb0

Browse files
committed
Updated CLI.
1 parent b24514f commit 81abcb0

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

quickbooks/tools/auth.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def get_oauth_1(self):
4040
realm_id = realm_id[0]
4141

4242
if oauth_verifier and realm_id:
43-
client = self.server.qb_client_class(
43+
client = Oauth1SessionManager(
4444
sandbox=qb_data['sandbox'],
4545
consumer_key=qb_data['consumer_key'],
4646
consumer_secret=qb_data['consumer_secret']
@@ -115,21 +115,20 @@ def get_oauth_2(self):
115115

116116

117117
class QuickBooksAuthServer(HTTPServer):
118-
119-
qb_client_class = Oauth1SessionManager
118+
#qb_client_class = Oauth1SessionManager
120119

121120
@classmethod
122121
def build_server(cls, consumer_key, consumer_secret, sandbox, port, oauth_version):
122+
callback_url = 'http://localhost:{0}'.format(port)
123123
if oauth_version == 1:
124124
client = Oauth1SessionManager(
125125
sandbox=sandbox,
126126
consumer_key=consumer_key,
127127
consumer_secret=consumer_secret,
128-
callback_url='http://localhost:{0}'.format(port)
129128
)
130129

131130
qb_data = {
132-
'authorize_url': client.get_authorize_url(),
131+
'authorize_url': client.get_authorize_url(callback_url),
133132
'request_token': client.request_token,
134133
'request_token_secret': client.request_token_secret,
135134
'consumer_key': consumer_key,
@@ -143,12 +142,11 @@ def build_server(cls, consumer_key, consumer_secret, sandbox, port, oauth_versio
143142
sandbox=sandbox,
144143
client_id=consumer_key,
145144
client_secret=consumer_secret,
146-
callback_url='http://localhost:{0}'.format(port),
147145
base_url='http://localhost:{0}'.format(port),
148146
)
149147

150148
qb_data = {
151-
'authorize_url': client.get_authorize_url(),
149+
'authorize_url': client.get_authorize_url(callback_url),
152150
'access_token': client.access_token,
153151
'refresh_token': client.refresh_token,
154152
'consumer_key': consumer_key,

0 commit comments

Comments
 (0)