Skip to content
This repository was archived by the owner on Aug 28, 2020. It is now read-only.

westphahl/hydra-client

Repository files navigation

DEPRECATED

This library is no longer maintained. Please use the official ORY Hydra package.

No Maintenance Intended Build Status

Python wrapper for the ORY Hydra OAuth2 and OpenID Connect server REST API.

Disclaimer: This library is still in alpha state!

Installation

pip install hydra-client

Basic usage

from hydra_client import HydraAdmin

hydra = HydraAdmin("http://localhost:4445")
login_request = hydra.login_request("challenge")
redirect_to = login_request.accept(subject="username")

See also the example login/consent provider.

Development

All code is formatted using black. Tests and static checks can be run with tox:

tox

Recording test data

The hydra-client uses Betamax for mocking and recording HTTP interactions.

Run Hydra in a Docker container:

   docker run \
      -it \
      --rm \
      -e "DSN=memory" \
      -e "URLS_SELF_ISSUER=http://localhost:4444/" \
      --name hydra \
      -p 4445:4445 \
      -p 4444:4444 \
      oryd/hydra:v1.0 \
      serve all --dangerous-force-http

Create a new OAuth2 client:

   docker exec \
      -it hydra \
       hydra clients create \
       --endpoint http://localhost:4445 \
       --id test-client \
       --secret test-secret \
       --callbacks http://client.localhost

Re-Record Betamax cassettes:

   BETAMAX_RECORD_MODE=all tox

About

DEPRECATED - Client library for ORY Hydra (OAuth2 and OpenID Connect provider)

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages