ProductPromotion
Logo

Scala

made by https://0x3d.site

GitHub - blackdoor/jose: Extensible JOSE library for Scala
Extensible JOSE library for Scala. Contribute to blackdoor/jose development by creating an account on GitHub.
Visit Site

GitHub - blackdoor/jose: Extensible JOSE library for Scala

GitHub - blackdoor/jose: Extensible JOSE library for Scala

jose

Codacy grade Travis (.com) Scaladoc Maven Central Gitter Matrix

Extensible JOSE library for Scala.

Installation

The dependency is available on Maven Central.

Usage

Pretty simple: make a key, make something to sign, sign it.

<sauce-code repo='blackdoor/jose' lang='scala' file='docs/src/black/door/jose/docs/SampleCode.scala' lines='15:36'

Selecting a JSON implementation

Currently supported JSON libraries:

To add a JSON support, just import or mix in an implementation like import black.door.jose.json.playjson.JsonSupport._.

If your preferred library isn't supported, just implement Mapper implicits (or open an issue to request they be added).

Async key resolution and validation checks

Frequently you will need to dynamically look up a new key from a keyserver based on a JWS header, or check a centralized cache to see if a token has been revoked.
This is easy to do asynchronously by implementing KeyResolver or JwtValidator.
JwtValidator is a partial function so you can easily chain both sync and async validations.
KeyResolver allows you to return an error in the event that there was a specific reason a key could not be found (perhaps a key does exist, but it's only for encryption and this token is using it for signing).

JWT validation DSL

There is a handy compile-safe DSL for JWT validation that allows you to indicate if you want to use unregistered claims, and if you want to evaluate synchronously or asynchronously. Its structure looks like this

Jwt
|__ .validate(compactJwt)
    |__ .using(keyResolver, etc...)
    |   |__ .now   // validates the JWT synchronously
    |   |__ .async // returns the validation result in a Future
    |__ .apply[UnregisteredClaims]
        |__ .using(keyResolver, etc...)
            |__ .now   // validates the JWT synchronously
            |__ .async // returns the validation result in a Future

So for example you could synchronously validate a JWT with some custom claims with

<sauce-code repo='blackdoor/jose' lang='scala' file='docs/src/black/door/jose/docs/SampleCode.scala' lines='64:77'


Not yet implemented:

  • JWK serialization partly implemented
  • JWE
  • RSA signing (RSA signature verification is supported)
  • Less common key sizes for ECDSA
  • Custom JOSE header parameters (custom JWT claims are supported)

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory