Coder Social home page Coder Social logo

auth-tokens's Introduction

Circle CI Download

Auth Tokens

Simple wrappers for tokens passed between services that rely on OAuth 2.0 for user authentication and authorization.

BearerToken

The value class presenting the OAuth 2.0 Bearer Token.

AuthHeader

A value class used to represent the HTTP Authorization header expected to contain a Bearer Token, and which contains utility methods for extracting the Bearer Token from the header's value.

UnverifiedJsonWebToken

Parses and provides insight into a Json Web Token payload.

Auth Token Filter

Provides a filter to inject user identifier information into slf4j and Jetty logging contexts.

Usage

Gradle:

dependencies {
    compile "com.palantir.tokens:auth-tokens:<version>"
    compile "com.palantir.tokens:auth-tokens-filter:<version>"
}

In your server's initialize method:

environment.jersey().register(BearerTokenLoggingFeature.class);

This is a jax-rs DynamicFeature which sets up either the BearerTokenLoggingFilter or the BearerTokenCookieLoggingFilter in front of each of your endpoints, depending on whether they have a @HeaderParam("Authorization") or a @CookieParam(*) BearerToken. If your endpoint has neither of these parameters then no filter will be added.

Contributing

Before working on the code, if you plan to contribute changes, please read the CONTRIBUTING document.

License

This repository is made available under the Apache 2.0 License.

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.