connector/oidc: expose oauth2.RegisterBrokenAuthHeaderProvider

This commit is contained in:
Eric Chiang
2017-03-20 08:38:52 -07:00
parent d31bb1c8d5
commit ac032e99f0
2 changed files with 78 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package oidc
import "testing"
func TestKnownBrokenAuthHeaderProvider(t *testing.T) {
tests := []struct {
issuerURL string
expect bool
}{
{"https://dev.oktapreview.com", true},
{"https://dev.okta.com", true},
{"https://okta.com", true},
{"https://dev.oktaaccounts.com", false},
{"https://accounts.google.com", false},
}
for _, tc := range tests {
got := knownBrokenAuthHeaderProvider(tc.issuerURL)
if got != tc.expect {
t.Errorf("knownBrokenAuthHeaderProvider(%q), want=%t, got=%t", tc.issuerURL, tc.expect, got)
}
}
}