File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ def __init__(
7777 super (OAuth2Session , self ).__init__ (** kwargs )
7878 self ._client = client or WebApplicationClient (client_id , token = token )
7979 self .token = token or {}
80- self .scope = scope
80+ self ._scope = scope
8181 self .redirect_uri = redirect_uri
8282 self .state = state or generate_token
8383 self ._state = state
@@ -97,6 +97,20 @@ def __init__(
9797 "protected_request" : set (),
9898 }
9999
100+ @property
101+ def scope (self ):
102+ """By default the scope from the client is used, except if overridden"""
103+ if self ._scope is not None :
104+ return self ._scope
105+ elif self ._client is not None :
106+ return self ._client .scope
107+ else :
108+ return None
109+
110+ @scope .setter
111+ def scope (self , scope ):
112+ self ._scope = scope
113+
100114 def new_state (self ):
101115 """Generates a state string to be used in authorizations."""
102116 try :
You can’t perform that action at this time.
0 commit comments