We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e3aaee commit dc5214fCopy full SHA for dc5214f
1 file changed
stashcp.py
@@ -138,8 +138,13 @@ def getToken():
138
139
# Read in the JSON
140
with open(scitoken_file, 'r') as scitoken_obj:
141
- token_json = json.load(scitoken_obj)
142
- scitoken_contents = token_json['access_token']
+ try:
+ token_json = json.load(scitoken_obj)
143
+ scitoken_contents = token_json['access_token']
144
+ except ValueError as jsonfail:
145
+ logging.info("Falling back to old style scitoken parsing")
146
+ scitoken_obj.seek(0)
147
+ scitoken_contents = scitoken_obj.read()
148
149
return scitoken_contents
150
0 commit comments