Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bettyblocks/fusion_jwt_authentication
https://github.com/bettyblocks/fusion_jwt_authentication
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bettyblocks/fusion_jwt_authentication
- Owner: bettyblocks
- License: mit
- Created: 2020-02-04T13:10:35.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-29T12:53:09.000Z (over 1 year ago)
- Last Synced: 2024-10-23T13:45:29.367Z (3 months ago)
- Language: Elixir
- Size: 53.7 KB
- Stars: 0
- Watchers: 11
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/nulian/fusion_jwt_authentication.svg?branch=master)](https://travis-ci.org/nulian/fusion_jwt_authentication)
# FusionJwtAuthentication
Library to authenticate jwt token with a plug.
Below can be configured in your app.
`claim_options` Follow the joker claims though you will probably need to set the iss and aud in a keyword list. `iss` is the jwt supplier name from the jwt.
`aud` is the application of fusionauth the jwt is used for logging in to.`base_url` Should be the url of fusionauth like `fusionauth.test.com`
```elixir
config :fusion_jwt_authentication,
http_client: HTTPoison,
claim_options: [],
base_url: ""
```## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `fusion_jwt_authentication` to your list of dependencies in `mix.exs`:```elixir
def deps do
[
{:fusion_jwt_authentication, "~> 0.5"}
]
end
```Can be added to a phoenix router pipeline like below. Cookies should also be fetched because at the moment it fetches jwt from cookies.
```elixir
pipeline :auth do
plug :fetch_cookies
plug FusionJWTAuthentication.FusionJWTAuthPlug
end
```Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/fusion_jwt_authentication](https://hexdocs.pm/fusion_jwt_authentication).### Backwards compatibility
In version 0.5 the dependency of phoenix was dropped, and therefore the ErrorView no longer be updated. If you need this stick to version 0.4.