[mhus lib] Implemented Bearer JWS tokens

 mhus now supports bearer tokens for authentication. I used the project jjwt to implement the tokens and added dependencies of the current version 0.11.2. The token is implemented to be used with apache shiro.

A new service JwtProvider implements creation and reading of the tokens. The keys if not exists will be created and stored in the keychain. Private and public keys in separate key sources. In this way the public keys can be published to other nodes.

A new interface BearerRealm must be used to mark realms with Bearer support. Using the interface a token can be created from the realm implementation. You should use the AccessUtil to create tokens.

The authentication is already implemented in rest and micro calls. Via rest a node '/jwt_token' can be used to create a token - expires after one hour - and use it as authentication.

To use jjwt with osgi I as forced to create a port project. First the 'feature' character of the bundles is not supported in the current felix/karaf version, second the use of java services is not successful in karaf.


Comments

Popular posts from this blog

Creating a flux sync configuration referring a config map for substitution

Sonatype Nexus fails with random "peer not authenticated" errors behind ingress

Create Spring Boot Images in Jenkins/CI in K8s, Part 1