Skip to content

Commit aaccbc9

Browse files
desimonebradfitz
authored andcommitted
google: update ApprovalForce to use openid connect friendly prompt=consent
It looks like in 2016 or so` approval_prompt=force` was replaced with the open id connect friendly `prompt=consent`. See: - https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest - https://developers.google.com/identity/sign-in/web/reference#gapiauth2offlineaccessoptions - googleapis/oauth2client#453 - pomerium/pomerium#82 Change-Id: Iad2d533f451a70b2941aafd11c9b7272026a2f16 GitHub-Last-Rev: d6d10ce GitHub-Pull-Request: #379 Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/171123 Reviewed-by: Brad Fitzpatrick <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 950ef44 commit aaccbc9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

oauth2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ var (
117117
// ApprovalForce forces the users to view the consent dialog
118118
// and confirm the permissions request at the URL returned
119119
// from AuthCodeURL, even if they've already done so.
120-
ApprovalForce AuthCodeOption = SetAuthURLParam("approval_prompt", "force")
120+
ApprovalForce AuthCodeOption = SetAuthURLParam("prompt", "consent")
121121
)
122122

123123
// An AuthCodeOption is passed to Config.AuthCodeURL.

oauth2_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func newConf(url string) *Config {
4343
func TestAuthCodeURL(t *testing.T) {
4444
conf := newConf("server")
4545
url := conf.AuthCodeURL("foo", AccessTypeOffline, ApprovalForce)
46-
const want = "server/auth?access_type=offline&approval_prompt=force&client_id=CLIENT_ID&redirect_uri=REDIRECT_URL&response_type=code&scope=scope1+scope2&state=foo"
46+
const want = "server/auth?access_type=offline&client_id=CLIENT_ID&prompt=consent&redirect_uri=REDIRECT_URL&response_type=code&scope=scope1+scope2&state=foo"
4747
if got := url; got != want {
4848
t.Errorf("got auth code URL = %q; want %q", got, want)
4949
}

0 commit comments

Comments
 (0)