Skip to content

Commit 2e36ea2

Browse files
committed
Removed references to the oAuth realm since
OX3 doesn't require a specified realm anymore.
1 parent 74b7394 commit 2e36ea2

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

ox3apiclient/__init__.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
else:
1818
import json
1919

20-
import oauth2_version as oauth
20+
#import oauth2_version as oauth
21+
import oauth2 as oauth
2122

2223
import urllib
2324
import urllib2
@@ -40,7 +41,7 @@
4041

4142
class Client(object):
4243

43-
def __init__(self, domain, realm, consumer_key, consumer_secret,
44+
def __init__(self, domain, consumer_key, consumer_secret,
4445
callback_url='oob',
4546
scheme='http',
4647
request_token_url=REQUEST_TOKEN_URL,
@@ -54,8 +55,6 @@ def __init__(self, domain, realm, consumer_key, consumer_secret,
5455
"""
5556
5657
domain -- Your UI domain. The API is accessed off this domain.
57-
realm -- Your sso realm. While not necessary for all OAuth
58-
implementations, it is a requirement for OpenX Enterprise
5958
consumer_key -- Your consumer key.
6059
consumer_secret -- Your consumer secret.
6160
callback_url -- Callback URL to redirect to on successful authorization.
@@ -68,7 +67,6 @@ def __init__(self, domain, realm, consumer_key, consumer_secret,
6867
"""
6968

7069
self.domain = domain
71-
self.realm = realm
7270
self.consumer_key = consumer_key
7371
self.consumer_secret = consumer_secret
7472
self.callback_url = callback_url
@@ -130,7 +128,6 @@ def _sign_request(self, req):
130128

131129
# Update our original requests headers to include the OAuth Authorization
132130
# header and return it.
133-
req.headers.update(oauth_req.to_header(realm=self.realm))
134131
return \
135132
urllib2.Request(req.get_full_url(), headers=req.headers, data=data)
136133

@@ -367,7 +364,6 @@ def client_from_file(file_path='.ox3rc', env=None):
367364
# Required parameters for a ox3apiclient.Client instance.
368365
required_params = [
369366
'domain',
370-
'realm',
371367
'consumer_key',
372368
'consumer_secret']
373369

@@ -383,7 +379,6 @@ def client_from_file(file_path='.ox3rc', env=None):
383379

384380
client = Client(
385381
domain=client_params['domain'],
386-
realm=client_params['realm'],
387382
consumer_key=client_params['consumer_key'],
388383
consumer_secret=client_params['consumer_secret'])
389384

0 commit comments

Comments
 (0)