THREESCALE-11015 - Support client_secret_jwt and private_key_jwt as authentication type for token introspection policy #1464
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Known issue
Some time failed with the following error
This is due to the use ofoneOf
and seems like a bug. I will need to investigate this further.The original intention was to add support for a single algorithm and then upgrade lua-retsy-jwt afterwards and have a minimal schema structure change. However, the jsonschema validation fails when the emum field only contains a single value so I decided to remove it for now.
@eguzki if you know a better way to buildapicast-config.json
or how to solve this problem, please let me knowWhat
This PR mainly adding 2 new authentication method for token introspection policy,
client_secret_jwt
andprivate_key_jwt
.JIRA: https://issues.redhat.com/browse/THREESCALE-11015
Reference: https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication
Why only HS256 and RS256 are supported?
This is due to the version of
lua-resty-jwt
(0.20) that we useSupport sign algorithm
HS384
HS512
HS512
HS512
HS512
RS382
RS512
ES256
ES384
ES512
PS256
PS384
PS512
ES256
RS512
ES256
ES512
Highest we can go is 0.2.2 but this only add support for ES256
0.2.3 introduce a new dependency lua-resty-openssl. See #1375 (comment)
Eventually we will need an update but given the amount of work involved, I'd like to keep version 0.20 for now
Verification steps:
Validate
client_secret_jwt
authentication methodclient-secret-jwt
admin/adminpass
basic
realmoidc-issuer-for-3scale
-> CredentialsClient Authenticator
toSigned JWT with Client Secret
and useHS256
algorithmValidate
private_key_jwt
authentication methodsigned_jwt
Client -> oidc-issuer-for-3scale -> Credentials
Client Authenticator
toSigned JWT
with RS256 signature algorithmKey
tab and click generate a new keyPCKS12
and fill in required fill and save keystore file to local diskkeystore.p12
file, run the following command to extract private keyReplace the content after
base64
with the based64 string of your certificate from previous step.