Skip to content

Commit

Permalink
fix: Accept application/text content-type for plain idtoken response
Browse files Browse the repository at this point in the history
On Cloud Run, the idtoken metadata endpoint has Content-Type application/text
  • Loading branch information
bouk committed Mar 30, 2021
1 parent 29a51d0 commit 4948ebb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/googleauth/compute_engine.rb
Expand Up @@ -112,7 +112,7 @@ def fetch_access_token options = {}
case resp.status
when 200
content_type = resp.headers["content-type"]
if content_type == "text/html"
if ["text/html", "application/text"].include? content_type
{ (target_audience ? "id_token" : "access_token") => resp.body }
else
Signet::OAuth2.parse_credentials resp.body, content_type
Expand Down

0 comments on commit 4948ebb

Please sign in to comment.