https://github.com/niku/jwk_store
Just use JWK without worrying about refreshing
https://github.com/niku/jwk_store
Last synced: about 1 month ago
JSON representation
Just use JWK without worrying about refreshing
- Host: GitHub
- URL: https://github.com/niku/jwk_store
- Owner: niku
- Created: 2019-10-09T10:39:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-10T10:53:58.000Z (over 6 years ago)
- Last Synced: 2025-01-12T16:41:32.507Z (over 1 year ago)
- Language: Elixir
- Size: 10.7 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JWKStore
Some JWT issuer(e.g. [google](https://developers.google.com/identity/protocols/OpenIDConnect)) refreshes JWK periodically.
To make you just use JWK without worrying about refreshing, this library handles refreshing JWK automatically.
Note: **Current status is experimental**.
## Usage
```elixir
uri = URI.parse("https://www.googleapis.com/oauth2/v3/certs")
{:ok, supervisor} = JWKStore.start_link(uri)
JWKStore.lookup("__input_kid_here__")
# %{
# "alg" => "RS256",
# "e" => "AQAB",
# "kid" => "8c58e138614bd58742172bd5080d197d2b2dd2f3",
# "kty" => "RSA",
# "n" => "yf3ymX8X1Q-vGALjH5eW56DQY2eJMoVzIn35IsxqSRpDEdoC-mp7EmC63feBp_1uRR9ITCwliuNYAV1yOmpSOstGDRknhp5mzmc_EovqDH4jwI_TWmsDMDZ7rHTKq5DFKzAVJlkk85OLbbt1PU1ZCF2eYtCzb57STrhvhmuAPgmoqROmNUKF5BcBQw7pvKqV2CjJRdKUmxs_zW9qNUYyDZaPYMfiloGjytsFsPp-lyQyxbXJoUbUD7jA6cUb3mOtzpROAgkYZyS740g-GZcVLapqAwC6UZxlCN-lXbGab7c-QrCMvDwfu2U3AQSvI38u95MabrjHZWsWRCbqJVfHIw",
# "use" => "sig"
# }
```
## Installation
```elixir
def deps do
[
{:jwk_store, github: "niku/jwk_store"}
]
end
```