Commit 28efdf35 authored by Gurvinder Singh's avatar Gurvinder Singh
Browse files

update token issuer to use RAWURLEncoding and return json coding to configuration as well

parent 4a9b37ad
Pipeline #11852 passed with stages
in 1 minute and 2 seconds
......@@ -41,6 +41,7 @@ func getOpenIDConfig() *OpenIDConfig {
func (oidcConf *OpenIDConfig) openidConfigHandler() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
encoder := json.NewEncoder(w)
encoder.Encode(oidcConf)
})
......
......@@ -16,7 +16,6 @@ type Key struct {
KType string `json:"kty"`
N string `json:"n"`
E string `json:"e"`
Key string `json:"x5c"`
}
type JWKS struct {
......@@ -39,9 +38,8 @@ func getJWKS() *JWKS {
e = make([]byte, 4)
binary.BigEndian.PutUint32(e, uint32(rsaKey.E))
key := Key{KType: "RSA",
Key: base64.URLEncoding.EncodeToString(keyBytes),
N: base64.URLEncoding.EncodeToString(rsaKey.N.Bytes()),
E: base64.URLEncoding.EncodeToString(e)}
N: base64.RawURLEncoding.EncodeToString(rsaKey.N.Bytes()),
E: base64.RawURLEncoding.EncodeToString(e)}
return &JWKS{Keys: []Key{key}}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment