GithubHelp home page GithubHelp logo

pifagor87 / authorization_microservice Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 5 KB

Authorization with basic authorization and token for microservice.

Go 100.00%
authorization golang go httprouter jwt-go

authorization_microservice's Introduction

Authorization with basic authorization and token for microservice.

A simple authentication system implemented using jwt-go. For building paths, we use a lightweight high-performance HTTP request router. To start using "authorization_microservice" you need:

  • Install and configure the latest version of Golang
  • Be sure to copy data.json and modify the data. Add access rights to the data.json to more complex.
  • Move the data.json file to a secure location on the server. Provide the necessary access rights.
  • To use authentication in your microservices, add in import - "github.com/pifagor87/authorization_microservice". When constructing your own microservice, use them in the following way, for example:

router := httprouter.New()

router.POST("my_url", authorization_microservice.BasicAuth(patch_to_data_json))

router.POST("my_url", authorization_microservice.ProtectedEndpoint(my_callback, patch_to_data_json))

Change the correct path to the file data.json. Replace "patch_to_data_json" with the desired path to the file.

Dependencies

  • github.com/dgrijalva/jwt-go
  • github.com/julienschmidt/httprouter

authorization_microservice's People

Contributors

pifagor87 avatar

Stargazers

 avatar

Watchers

 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.