@@ -121,7 +121,7 @@ type OIDCService struct {
121121
122122 clients map [string ]model.OIDCClientConfig
123123 privateKey * rsa.PrivateKey
124- publicKey crypto .PublicKey
124+ publicKey * rsa .PublicKey
125125 issuer string
126126}
127127
@@ -271,7 +271,7 @@ func NewOIDCService(
271271
272272 clients : clients ,
273273 privateKey : privateKey ,
274- publicKey : publicKey ,
274+ publicKey : publicKey .( * rsa. PublicKey ) ,
275275 issuer : issuer ,
276276 }
277277
@@ -296,7 +296,7 @@ func (service *OIDCService) ValidateAuthorizeParams(req AuthorizeRequest) error
296296 if ! ok {
297297 return errors .New ("access_denied" )
298298 }
299-
299+
300300 // Redirect URI to verify that it's trusted
301301 if ! slices .Contains (client .TrustedRedirectURIs , req .RedirectURI ) {
302302 return errors .New ("invalid_request_uri" )
@@ -455,7 +455,7 @@ func (service *OIDCService) generateIDToken(client model.OIDCClientConfig, user
455455
456456 hasher := sha256 .New ()
457457
458- der := x509 .MarshalPKCS1PublicKey (& service .privateKey . PublicKey )
458+ der := x509 .MarshalPKCS1PublicKey (service .publicKey )
459459
460460 if der == nil {
461461 return "" , errors .New ("failed to marshal public key" )
@@ -813,7 +813,7 @@ func (service *OIDCService) cleanupRoutine() {
813813func (service * OIDCService ) GetJWK () ([]byte , error ) {
814814 hasher := sha256 .New ()
815815
816- der := x509 .MarshalPKCS1PublicKey (& service .privateKey . PublicKey )
816+ der := x509 .MarshalPKCS1PublicKey (service .publicKey )
817817
818818 if der == nil {
819819 return nil , errors .New ("failed to marshal public key" )
0 commit comments