Allow clearing default Azure and Google auth code options (#4315)

Allow users to clear the default IdP auth code options, by explicitly
setting an empty idp_request_params map.

To do this in a YAML config file, set:

    idp_request_params: {}
This commit is contained in:
Kenneth Jenkins 2023-06-27 09:11:54 -07:00 committed by GitHub
parent 1f839554c9
commit 2bf83e20d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 70 additions and 2 deletions

View file

@ -0,0 +1,23 @@
package azure
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/pomerium/pomerium/internal/identity/oauth"
)
func TestAuthCodeOptions(t *testing.T) {
var options oauth.Options
p, err := New(context.Background(), &options)
require.NoError(t, err)
assert.Equal(t, defaultAuthCodeOptions, p.AuthCodeOptions)
options.AuthCodeOptions = map[string]string{}
p, err = New(context.Background(), &options)
require.NoError(t, err)
assert.Equal(t, map[string]string{}, p.AuthCodeOptions)
}