Coder Social home page Coder Social logo

gsleeman / token-refresher Goto Github PK

View Code? Open in Web Editor NEW

This project forked from observatorium/token-refresher

0.0 0.0 0.0 8.74 MB

Write OAuth2 access tokens to disk

License: Apache License 2.0

Shell 23.48% Go 34.90% Makefile 22.97% Dockerfile 4.43% Jsonnet 14.22%

token-refresher's Introduction

Token-Refresher

CircleCI Go Report Card

token-refresher is a helper that fetches and refreshes OAuth2 access tokens via OIDC. It can do two things with these tokens:

  1. write them to a file on disk; tokens are refreshed before expiration so that the file always holds a valid token; and
  2. provide an HTTP proxy that adds an HTTP Authorization header containing the token to all outgoing requests.

token-refresher enables applications that only know how to read bearer tokens from a file or make HTTP requests to interface with APIs that are secured with OAuth2.

Note: the proxy should be used with care as any client that can access the API can impersonate the configured OAuth2 client.

Usage

Usage of ./token-refresher:
      --debug.name string            A name to add as a prefix to log lines. (default "token-refresher")
      --file string                  The path to the file in which to write the retrieved token.
      --log.format string            The log format to use. Options: 'logfmt', 'json'. (default "logfmt")
      --log.level string             The log filtering level. Options: 'error', 'warn', 'info', 'debug'. (default "info")
      --margin duration              The margin of time before a token expires to try to refresh it. (default 5m0s)
      --oidc.audience string         The audience for whom the access token is intended, see https://openid.net/specs/openid-connect-core-1_0.html#IDToken.
      --oidc.client-id string        The OIDC client ID, see https://tools.ietf.org/html/rfc6749#section-2.3.
      --oidc.client-secret string    The OIDC client secret, see https://tools.ietf.org/html/rfc6749#section-2.3.
      --oidc.issuer-url string       The OIDC issuer URL, see https://openid.net/specs/openid-connect-discovery-1_0.html#IssuerDiscovery.
      --url string                   The target URL to which to proxy requests. All requests will have the acces token in the Authorization HTTP header.
      --web.internal.listen string   The address on which the internal server listens. (default ":8081")
      --web.listen string            The address on which the proxy server listens. (default ":8080")

token-refresher's People

Contributors

douglascamata avatar squat avatar onprem avatar periklis avatar spaparaju avatar 2uasimojo avatar kakkoyun avatar matej-g avatar bwplotka avatar yeya24 avatar georgettica 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.