Skip to content

Commit 35b8e03

Browse files
committed
oidc: improve error message for mismatched issuer URLs
Fixes #468
1 parent e958473 commit 35b8e03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

oidc/oidc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ var supportedAlgorithms = map[string]bool{
162162
// parsing.
163163
//
164164
// // Directly fetch the metadata document.
165-
// resp, err := http.Get("https://login.example.com/custom-metadata-path")
165+
// resp, err := http.Get("https://login.example.com/custom-metadata-path")
166166
// if err != nil {
167167
// // ...
168168
// }
@@ -267,7 +267,7 @@ func NewProvider(ctx context.Context, issuer string) (*Provider, error) {
267267
issuerURL = issuer
268268
}
269269
if p.Issuer != issuerURL && !skipIssuerValidation {
270-
return nil, fmt.Errorf("oidc: issuer did not match the issuer returned by provider, expected %q got %q", issuer, p.Issuer)
270+
return nil, fmt.Errorf("oidc: issuer URL provided to client (%q) did not match the issuer URL returned by provider (%q)", issuer, p.Issuer)
271271
}
272272
var algs []string
273273
for _, a := range p.Algorithms {

0 commit comments

Comments
 (0)