| OLD | NEW |
| 1 # Copyright 2011 Google Inc. | 1 # Copyright 2011 Google Inc. |
| 2 # | 2 # |
| 3 # Licensed under the Apache License, Version 2.0 (the "License"); | 3 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 # you may not use this file except in compliance with the License. | 4 # you may not use this file except in compliance with the License. |
| 5 # You may obtain a copy of the License at | 5 # You may obtain a copy of the License at |
| 6 # | 6 # |
| 7 # http://www.apache.org/licenses/LICENSE-2.0 | 7 # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 # | 8 # |
| 9 # Unless required by applicable law or agreed to in writing, software | 9 # Unless required by applicable law or agreed to in writing, software |
| 10 # distributed under the License is distributed on an "AS IS" BASIS, | 10 # distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 if provider.name != 'google': | 35 if provider.name != 'google': |
| 36 raise NotReadyToAuthenticate() | 36 raise NotReadyToAuthenticate() |
| 37 | 37 |
| 38 def add_auth(self, http_request): | 38 def add_auth(self, http_request): |
| 39 user = users.get_current_user() | 39 user = users.get_current_user() |
| 40 credentials = StorageByKeyName( | 40 credentials = StorageByKeyName( |
| 41 Credentials, user.user_id(), 'credentials').get() | 41 Credentials, user.user_id(), 'credentials').get() |
| 42 if not credentials or credentials.invalid: | 42 if not credentials or credentials.invalid: |
| 43 raise NotReadyToAuthenticate() | 43 raise NotReadyToAuthenticate() |
| 44 http_request.headers['Authorization'] = ( | 44 http_request.headers['Authorization'] = ( |
| 45 'OAuth %s' % str(credentials.access_token)) | 45 'Bearer %s' % str(credentials.access_token)) |
| OLD | NEW |