Skip to content

TOMEE-2332 MP-jwt-jwk example#342

Closed
cotnic wants to merge 3 commits intoapache:masterfrom
cotnic:TOMEE-2332
Closed

TOMEE-2332 MP-jwt-jwk example#342
cotnic wants to merge 3 commits intoapache:masterfrom
cotnic:TOMEE-2332

Conversation

@cotnic
Copy link
Copy Markdown
Contributor

@cotnic cotnic commented Jan 2, 2019

Implemented the MP-jwt for JWKs public key example.

Also included the usage of MP-rest-client for testing.

Copy link
Copy Markdown
Contributor

@jeanouii jeanouii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sample is great and ready to be merged. I left some comments for the sake of having the discussion and hopefully clarify some stuff;

....
. Annotate our `Application.class` with `@LoginConfig(authMethod = "MP-JWT")`

. Provide public and private key for authentication. And specify the location of the public key and the issuer in our
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's actually required is the public key because MicroProfile JWT targets the validation side (consuming a JWT). The private key would be useful on the producer side of things such as an identity provider, or an API Gateway.


We access endpoints from our test class by creating a `JWT` with the help of
our `TokenUtils.generateJWTString(String jsonResource, String keyId)` which signs our user
data in json format with the help of our `src/test/resources/{keyId}` key.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where you need the private key, but this is for testing purpose to generate a valide and signed JWT

<scope>test</scope>
</dependency>

<!--
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small detail, but looks like some test dependencies are before this section, not sure it's intended or not.
It's a detail so won't prevent the merge at all

@cotnic
Copy link
Copy Markdown
Contributor Author

cotnic commented Jan 3, 2019

@jeanouii I've changed and improved the README and pom.xml based on your comments.

@asfgit asfgit closed this in 8bf7c0c Jan 4, 2019
@radcortez
Copy link
Copy Markdown
Contributor

Looks great @cotnic . Merged!

@cotnic cotnic deleted the TOMEE-2332 branch January 5, 2019 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants