Coder Social home page Coder Social logo

matthias-jaeger-net / authmicroservice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gajgele/authmicroservice

0.0 1.0 0.0 87 KB

:construction: This is boilerplate project for authentication and authorization microservice based on Lumen + JWT.

PHP 98.98% ApacheConf 1.02%

authmicroservice's Introduction

AuthMicroservice Boilerplate Project

License

AuthMicroservice is boilerplate code for REST service that handles authentication and authorization for users. The service provides the following functionality, provided as API endpoints:

Authentication:

  • Authenticate a user (with a password), create a session and return a session token (should be a JWT token)
  • Validate a session token
  • Close a session

Authorization:

  • Retrieve permissions for a user + session combination
  • Grant and revoke permissions for users
  • Authorize endpoint that responds to "can user X execute action Y"

Implementation

  • PHP framework Lumen
  • MySQL with Eloquent as a ORM
  • Each distinct functionality as a separate API endpoint
  • Sessions (and their tokens) as well as granted permissions are be saved in a database

Additional features

  • Scripts for creating database
  • Scripts for quick database seeding

License

The Lumen framework is open-sourced software licensed under the MIT license JWT for Lumen implementation from tymondesigns/jwt-auth

Examples

For now, all endpoint test are stored within AuthMicroservice Postman collection. These examples are mapped to local environment setup at localhost:8000 with api prefix "api/v1".

Installation

  1. Clone this repository to your development/server machine
  2. Update /vendor directory with "composer update -vvv"
  3. Create .env file (from .env.example)
  4. Update .env file with APP_KEY
  5. Update .env file with DB_DATABASE, DB_USERNAME, DB_PASSWORD
  6. Generate JWT_SECRET with "php artisan jwt:secret"
  7. Generate required databases with "php artisan migrate"
  8. Generate example data with "php artisan db:seed"
  9. Run application with "php -S localhost:8000 -t public" or other IP:PORT combination.

authmicroservice's People

Contributors

milanlatinovic avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.