googleauth 1.17.3 → 1.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +17 -15
- data/lib/googleauth/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80e7d42875ba60430bd7e7d19e7dfac71514b6da226506f7dab6dbc19a8cefa0
|
|
4
|
+
data.tar.gz: 0e863ef1dd4f84d84c7a7882982ac67231f811a29c5ba0dbb83fe2fe74477220
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1fa8c0bd685703caee6191860a57d1dfd9685d344175e7c08f3c63fce115ae3bf93b4d0f8b50147cdf5ef4c0b2a5b965fc6bfb0cb7b445cf3d84fabe5a122055
|
|
7
|
+
data.tar.gz: afc720473d4c6fb3e439b1695452977b56217dce473716506c89ec12cd134e2a0a17588e4ebdb2460cbcf113b89c22d0145001b282f3a7e090a831a1d3d95cb2
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Release History
|
|
2
2
|
|
|
3
|
+
### 1.17.4 (2026-08-13)
|
|
4
|
+
|
|
5
|
+
#### Documentation
|
|
6
|
+
|
|
7
|
+
* Update CLI/installed app example to use loopback IP redirect ([#589](https://github.com/googleapis/google-auth-library-ruby/issues/589))
|
|
8
|
+
|
|
3
9
|
### 1.17.3 (2026-07-27)
|
|
4
10
|
|
|
5
11
|
#### Bug Fixes
|
data/README.md
CHANGED
|
@@ -145,30 +145,32 @@ get('/oauth2callback') do
|
|
|
145
145
|
end
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
-
### Example (Command Line)
|
|
148
|
+
### Example (Command Line / Installed App)
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
Command line and desktop applications should use the Loopback IP redirect flow (`http://localhost`) as recommended in the [OOB Migration Guide](https://developers.google.com/identity/protocols/oauth2/resources/oob-migration).
|
|
151
151
|
|
|
152
152
|
```ruby
|
|
153
|
-
require
|
|
154
|
-
require
|
|
153
|
+
require "googleauth"
|
|
154
|
+
require "googleauth/stores/file_token_store"
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
LOOPBACK_URI = "http://localhost"
|
|
157
157
|
|
|
158
|
-
scope =
|
|
159
|
-
client_id = Google::Auth::ClientId.from_file
|
|
160
|
-
token_store = Google::Auth::Stores::FileTokenStore.new
|
|
161
|
-
|
|
162
|
-
authorizer = Google::Auth::UserAuthorizer.new(client_id, scope, token_store)
|
|
158
|
+
scope = "https://www.googleapis.com/auth/drive"
|
|
159
|
+
client_id = Google::Auth::ClientId.from_file "/path/to/client_secrets.json"
|
|
160
|
+
token_store = Google::Auth::Stores::FileTokenStore.new file: "/path/to/tokens.yaml"
|
|
161
|
+
authorizer = Google::Auth::UserAuthorizer.new client_id, scope, token_store
|
|
163
162
|
|
|
164
|
-
user_id = ENV[
|
|
165
|
-
credentials = authorizer.get_credentials
|
|
163
|
+
user_id = ENV["USER"]
|
|
164
|
+
credentials = authorizer.get_credentials user_id
|
|
166
165
|
if credentials.nil?
|
|
167
|
-
url = authorizer.get_authorization_url
|
|
168
|
-
puts "Open
|
|
166
|
+
url = authorizer.get_authorization_url base_url: LOOPBACK_URI
|
|
167
|
+
puts "Open the following URL in your browser: #{url}"
|
|
168
|
+
puts "After authorizing, your browser will redirect to localhost with an authorization code."
|
|
169
|
+
puts "Enter the authorization code:"
|
|
169
170
|
code = gets
|
|
170
171
|
credentials = authorizer.get_and_store_credentials_from_code(
|
|
171
|
-
user_id: user_id, code: code, base_url:
|
|
172
|
+
user_id: user_id, code: code, base_url: LOOPBACK_URI
|
|
173
|
+
)
|
|
172
174
|
end
|
|
173
175
|
|
|
174
176
|
# OK to use credentials
|
data/lib/googleauth/version.rb
CHANGED