We are using Ping Federate as authentication server and plan to build microservices on top of Spring boot. The idea is that Ping Federate will handle the login and provide access tokens (JWT) to client apps which then use those to access the REST services.
To validate the token, Ping Federate exposes the certificate containing the public key via an URL. It simply returns the certificate like that:
-----BEGIN CERTIFICATE-----
MIIDAjCCAeqgAwIBAgIGAVKHvf+JMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAkNBMRAwDgYD
VQQKEwdVbml0cm9uMSEwHwYDVQQDExhpbnQtc2lnbm9uLm15dW5pdHJvbi5jb20wHhcNMTYwMTI4
MTAxODQxWhcNMjEwNzIwMDkxODQxWjBCMQswCQYDVQQGEwJDQTEQMA4GA1UEChMHVW5pdHJvbjEh
MB8GA1UEAxMYaW50LXNpZ25vbi5teXVuaXRyb24uY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
MIIBCgKCAQEAk2PRFPfaQjjhVllok1Xq+Tybkg9Nv3XhSRjpq06iV8CzjJ8T8uwK//TLYM2Z7rqP
NDrMmzUhjwEM4WVAJf6stj7D2uQ01MU8sZTlQ3mygWm9qnJnijMyk0081oe429iabRGYfik2SvLd
Nqj53UUP858Qfk82LFjXdC2G2XkxB2ejwirsdQ/8ud6Sduom5NdIXNzMN3uucZ996wIdHwEhFBzV
eMSlY1LJAiKtwsTq6aP/A/GPBrEBa5Duiiz/z91KBNIlfiXEcxRjPgkJVgVpfVv0o7XBIoKnS4y8
uurlBlpT3fg6JLifBtkYe+Y8tV0DjFdE8LSMzpYOXdT4h069LwIDAQABMA0GCSqGSIb3DQEBBQUA
A4IBAQAaibNAZ7/fmdsoTg0vb4jqYFR1WrsqZ7M+7D0fMRNtBAziLBjzlsv2CuP+Zn3tvoon0QQO
/PzEIxTlWXv+F25ej2owK7J3ovyZyQBVNyjv8S/YZfSYkbKQo1DtbKhEAzQyBMiY611jbcbo2TDz
mvH436SipBgZqG0vK+ZzMcp4HVp2xAtwD567oj0AbP6VHkJUgWyiE7HOf+FSlq07jPuy/Hbw2/lJ
ZI1inmPVpuUCJ3pdfzfI2f4ETLzroQ588BnGnsLPIUH6W3r2JMAA1m5WbWc9w1VWJJelzHxlIdFg
yoEGcZn7wctVooeEzS/ghoelwFVXCKad30GnmtXdoXj+
-----END CERTIFICATE-----
When setting the security.oauth.resource.jwt.key-uri
property to that endpoint, the auto configuration in ResourceServerTokenServicesConfiguration
fails because it expects not just a simple string but wants to map it into a map. In a second step the JwtAccessTokenConverter
would also fail because it expects a "plain" public key but not a public key wrapped in a certificate.
What is the best approach to extend the spring security oauth component to support my IDP? I was thinking about overriding some of the configurations in ResourceServerTokenServicesConfiguration
but it looks like the one interesting for me (JwtAccessTokenConverter
) does not support overriding.