Skip to content

Commit

Permalink
fix: add offline_access to discovery supported scoped (#1870)
Browse files Browse the repository at this point in the history
Closes #1866

Signed-off-by: sawadashota <xiootas@gmail.com>
  • Loading branch information
sawadashota authored May 25, 2020
1 parent f557c9a commit 73464e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion driver/configuration/provider_viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ func (v *ViperProvider) OIDCDiscoverySupportedClaims() []string {
func (v *ViperProvider) OIDCDiscoverySupportedScope() []string {
return stringslice.Unique(
append(
[]string{"offline", "openid"},
[]string{"offline_access", "offline", "openid"},
viperx.GetStringSlice(v.l, ViperKeyOIDCDiscoverySupportedScope, []string{}, "OIDC_DISCOVERY_SCOPES_SUPPORTED")...,
),
)
Expand Down
2 changes: 1 addition & 1 deletion driver/configuration/provider_viper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func TestViperProviderValidates(t *testing.T) {
assert.Equal(t, []string{"hydra.openid.id-token"}, c.WellKnownKeys())
assert.Equal(t, urlx.ParseOrPanic("https://example.com"), c.OAuth2ClientRegistrationURL())
assert.Equal(t, []string{"sub", "username"}, c.OIDCDiscoverySupportedClaims())
assert.Equal(t, []string{"offline", "openid", "whatever"}, c.OIDCDiscoverySupportedScope())
assert.Equal(t, []string{"offline_access", "offline", "openid", "whatever"}, c.OIDCDiscoverySupportedScope())
assert.Equal(t, "https://example.com", c.OIDCDiscoveryUserinfoEndpoint())

// oidc
Expand Down

0 comments on commit 73464e1

Please sign in to comment.