Skip to content

Commit

Permalink
Parse OIDC Issuer URL (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Mofasser authored Sep 6, 2019
1 parent 5010ea9 commit 95cf0ab
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pkg/proxy/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import (
"crypto/x509"
"encoding/json"
"encoding/pem"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"path"
"time"
)

Expand Down Expand Up @@ -82,8 +83,15 @@ func getKeys(u string, ca *x509.Certificate, i bool) (*JWKS, error) {
// Accepts a trusted CA certificate as well as a bool to skip tls verification
func getWellKnown(u string, ca *x509.Certificate, i bool) (*openIDConfiguration, error) {

wellKnownURL := fmt.Sprintf("%s/%s", u, "/.well-known/openid-configuration")
req, err := http.NewRequest("GET", wellKnownURL, nil)
ul, err := url.Parse(u)
if err != nil {
return nil, err
}

ul.Path = path.Join(ul.Path, ".well-known/openid-configuration")

//wellKnownURL := fmt.Sprintf("%s/%s", u, "/.well-known/openid-configuration")
req, err := http.NewRequest("GET", ul.String(), nil)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 95cf0ab

Please sign in to comment.