All Projects → rootkc → phx-auth-api

rootkc / phx-auth-api

Licence: other
Authentication for Phoenix with JWT, user privileges and CI

Programming Languages

elixir
2628 projects
shell
77523 projects

Projects that are alternatives of or similar to phx-auth-api

phoenix example
An example Phoenix app with one-click deployments to different cloud services.
Stars: ✭ 62 (+376.92%)
Mutual labels:  heroku, phoenix
Papercups
Open-source live customer chat
Stars: ✭ 4,554 (+34930.77%)
Mutual labels:  heroku, phoenix
jt tools
Ruby on Rails Continuous Deployment Ecosystem to maintain Healthy Stable Development
Stars: ✭ 13 (+0%)
Mutual labels:  heroku, circleci
Guardian
Elixir Authentication
Stars: ✭ 3,150 (+24130.77%)
Mutual labels:  phoenix, guardian
Express Webpack React Redux Typescript Boilerplate
🎉 A full-stack boilerplate that using express with webpack, react and typescirpt!
Stars: ✭ 156 (+1100%)
Mutual labels:  heroku, circleci
food-help
A clone of popular food and business review web app yelp
Stars: ✭ 24 (+84.62%)
Mutual labels:  heroku, bcrypt
Skyhook
Parses webhooks and forwards them in the proper format to Discord.
Stars: ✭ 263 (+1923.08%)
Mutual labels:  heroku, circleci
Tilex
Today I Learned
Stars: ✭ 418 (+3115.38%)
Mutual labels:  heroku, phoenix
Habits
An Elixir/Phoenix app for tracking daily habits, ready to deploy to Heroku.
Stars: ✭ 55 (+323.08%)
Mutual labels:  heroku, phoenix
Phoenix Chat Example
💬 A Step-by-Step Beginners Tutorial for Building, Testing & Deploying a Chat app in Phoenix 1.5.5 🚀
Stars: ✭ 452 (+3376.92%)
Mutual labels:  heroku, phoenix
guardian trackable
A Guardian hook to track user sign ins.
Stars: ✭ 25 (+92.31%)
Mutual labels:  phoenix, guardian
react-phoenix-users-boilerplate
Elixir/Phoenix + React + users template/boilerplate.
Stars: ✭ 71 (+446.15%)
Mutual labels:  heroku, phoenix
generator-vars-jekyll
Generator for raw web app with CircleCI, Jekyll, Webpack, Express + more.
Stars: ✭ 18 (+38.46%)
Mutual labels:  heroku, circleci
avatica
DEPRECATED - Moved to github.com/apache/calcite-avatica-go
Stars: ✭ 42 (+223.08%)
Mutual labels:  phoenix
cimg-go
The CircleCI Go (Golang) Docker Convenience Image.
Stars: ✭ 13 (+0%)
Mutual labels:  circleci
capture-website-api
Capture screenshots of websites as a (host it yourself) API
Stars: ✭ 30 (+130.77%)
Mutual labels:  heroku
imagery
Slack app to upload shared images to Imgur to save space and share easily
Stars: ✭ 29 (+123.08%)
Mutual labels:  heroku
SPaaS
A Simple-PaaS similar to Heroku
Stars: ✭ 18 (+38.46%)
Mutual labels:  heroku
books-store
A Simple Web application to use flask python web framework.
Stars: ✭ 23 (+76.92%)
Mutual labels:  heroku
lighthouse-circleci-example
An example repo demonstrating Lighthouse testing in CircleCi
Stars: ✭ 21 (+61.54%)
Mutual labels:  circleci

PhxAuthApi

Features

This project implements Guardian for JWT authentication and Canary for user specific authorization. For hashing passwords in the database comeonin is used with the bcrypt algorithm. The JWT token controls access to a certain endpoint and then Canary is used to figure out if the resource from the JWT has access to that endpoint. This makes this setup very dynamic for many authentication purposes.

CircleCI test and deployment of master to Heroku is also implemented.

Endpoints

All endpoints have Content-Type: application/json in the header

URL METHOD HEADER BODY
/api/login POST none { "user": { "username": "", "password": "" } }
/api/users GET none { "user": { "username": "", "password": "" } }
/api/users POST none { "user": { "username": "", "password": "" } }
/api/users/:id PUT authorization: jwt { "user": { "username": "", "password": "" } }
/api/users/:id DELETE authorization: jwt { "user": { "username": "", "password": "" } }

Installation

  • Clone repo by git clone https://github.com/rootkc/phx-auth-api
  • go to directory with cd phx-auth-api
  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.create && mix ecto.migrate
  • Start Phoenix endpoint with mix phx.server

Now you can visit localhost:4000/api/users from your browser to fetch all users.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].