Giter VIP home page Giter VIP logo

rdap-openid-proxy's Introduction

rdap-openid-proxy

Build Status

An OpenID Connect authentication proxy for an RDAP server, based on draft-ietf-regext-rdap-openid. This is a proof-of-concept only, and is not intended for production use.

Dependencies

Perl dependencies are listed in Makefile.PL.

Installation

perl Makefile.PL
make
make test
sudo make install

Configuration

Configuration is in YAML format, like so:

port: {port}
base_rdap_url: {base-rdap-url}
dnt_supported: {boolean}
issuer_identifier_supported: {boolean}
implicit_token_refresh_supported: {boolean}
idp_details:
  {name}:
    id: {idp-client-id}
    name: {idp-name}
    secret: {idp-client-secret}
    discovery_uri: {idp-discovery-uri}
  ...
redirect_uri: {redirect-uri}
idp_mappings:
  - [ {regex}, {name} ]
  - ...
filters:
  unauthenticated:
    {filter_name}: {enabled}
  authenticated:
    {filter_name}: {enabled}

port is the port on which the server will run.

base_rdap_url is the base URL of the RDAP server for which this server is operating as a proxy.

dnt_supported indicates whether 'do not track'-style functionality is supported (defaults to false).

issuer_identifier_supported indicates whether the client can specify an ISS value manually in a 'login' request (defaults to true).

implicit_token_refresh_supported indicates whether the server will attempt to refresh the access token if it has expired (defaults to true).

idp_details maps from a server-specific name for an identity provider to the configuration details for that provider. idp-name is a descriptive string that is returned in the RDAP /help response.

idp_mappings is a list of lists, where each element list contains a Perl regular expression and an identity provider name. This is used to map from the user-provided id argument to an identity provider: the provider for the first expression that matches the id argument will be used for the relevant request. Provider issuer discovery is not currently implemented.

filters affect how requests to or responses from the proxied RDAP server are handled. For unauthenticated requests, two filters are defined:

  • no_entities, which strips top-level entities from the response; and
  • deny, which returns 403 Forbidden for all requests.

For authenticated requests, two filters are defined:

  • pass_authenticated, which passes an authenticated=1 query argument to the backend; and
  • pass_purpose, which passes the purposes from the user's claims to the backend.

Example usage

Using a configuration file like so, with Google as the provider:

port: 38279
base_rdap_url: http://rdap.apnic.net
idp_details:
  google:
    id: {client-id}.apps.googleusercontent.com
    secret: {client-secret}
    discovery_uri: https://accounts.google.com/.well-known/openid-configuration
idp_mappings:
  - [ "@gmail.com", "google" ]
filters:
  unauthenticated:
    no_entities: 1

A standard request can be sent like so:

$ curl http://localhost:38279/domain/203.in-addr.arpa
{"ldhName":"203.in-addr.arpa", ...

To log in via an OIDC provider, the client sends a request to the 'login' endpoint. (In this instance, because there is only one IDP, there is no need to provide the identifier in the request. However, depending on the configuration, an identifier and/or an issuer identifier may need to be provided.)

After logging in successfully, subsequent RDAP requests will be considered authenticated.

Notes

  • This has been tested with Google's identity provider and with Keycloak. Other providers may not work as expected.

License

See LICENSE.txt.

rdap-openid-proxy's People

Contributors

tomhrr avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

rdap-openid-proxy's Issues

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.