Giter Club home page Giter Club logo

fakesso's Introduction

fakesso

A really insecure oauth2 provider implementation.

Provides the following endpoints:

/o/authorize/

Redirect your user to /o/authorize/?response_type=code&client_id=whatever&redirect_uri=http%3A%2F%2Flocalhost%3A9001%2Flogin%2Fcallback%2F&state=1234 and fakesso will redirect them to the redirect_uri you provided with the same state you provided and an additional query-param called code.

/o/token/

Http POST to /o/token/ with the code you were given (or any code, it doesn't care). If you want it to return any custom scopes then just add scope=whatever to your POST body.

It'll return you an access token in the form:

{
    "access_token": "RFHEYFGWTPGNRCAAMYAD",
    "expires_in": 57861,
    "scope": "read write",
    "token_type": "Bearer"
}

/o/introspect/

If you're using an app that is validating oauth2 access tokens using RFC 7662, then point that app to use the provided introspect endpoint. It will respond saying that any access_token is active and expires in the future.

If you want it to return any custom scopes then just add scope=whatever to your POST body.

{
    "active": true,
    "exp": 96348,
    "scope": "read write"
}

User Getting Started

  1. Download a release: releases
  2. make sure you have java 8
  3. decide what port you want it running on and export the PORT environment variable: export PORT=12345
  4. Run java -jar fakesso-0.0.3-standalone.jar

Developer Getting Started

  1. Start the application: lein run
  2. Go to localhost:8080.
  3. Read your app's source code at src/fakesso/service.clj. Explore the docs of functions that define routes and responses.
  4. Run your app's tests with lein test. Read the tests at test/fakesso/service_test.clj.
  5. Learn more! See the Links section below.

Configuration

To configure logging see config/logback.xml. By default, the app logs to stdout. To learn more about configuring Logback, read its documentation.

Developing your service

  1. Start a new REPL: lein repl
  2. Start your service in dev-mode: (def dev-serv (run-dev))
  3. Connect your editor to the running REPL session. Re-evaluated code will be seen immediately in the service.

Docker container support

  1. Build an uberjar of your service: lein uberjar
  2. Build a Docker image: sudo docker build -t fakesso .
  3. Run your Docker image: docker run -p 8080:8080 fakesso

OSv unikernel support with Capstan

  1. Build and run your image: capstan run -f "8080:8080"

Once the image it built, it's cached. To delete the image and build a new one:

  1. capstan rmi fakesso; capstan build

Links

fakesso's People

Contributors

r4vi avatar

Stargazers

 avatar  avatar  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.