Skip to content

MadisonEhlers-Vertex/hydra-client-java

 
 

Repository files navigation

hydra-client

ORY Hydra

  • API version: v0.0.0-alpha.2
    • Build date: 2020-01-04T16:01:02.111610+01:00[Europe/Berlin]

Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven/Gradle

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>sh.ory.hydra</groupId>
  <artifactId>hydra-client</artifactId>
  <version>v0.0.0-alpha.2</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "sh.ory.hydra:hydra-client:v0.0.0-alpha.2"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/hydra-client-v0.0.0-alpha.2.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

// Import classes:
import sh.ory.hydra.ApiClient;
import sh.ory.hydra.ApiException;
import sh.ory.hydra.Configuration;
import sh.ory.hydra.models.*;
import sh.ory.hydra.api.AdminApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");

    AdminApi apiInstance = new AdminApi(defaultClient);
    String consentChallenge = "consentChallenge_example"; // String | 
    AcceptConsentRequest body = new AcceptConsentRequest(); // AcceptConsentRequest | 
    try {
      CompletedRequest result = apiInstance.acceptConsentRequest(consentChallenge, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AdminApi#acceptConsentRequest");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
AdminApi acceptConsentRequest PUT /oauth2/auth/requests/consent/accept Accept an consent request
AdminApi acceptLoginRequest PUT /oauth2/auth/requests/login/accept Accept an login request
AdminApi acceptLogoutRequest PUT /oauth2/auth/requests/logout/accept Accept a logout request
AdminApi createJsonWebKeySet POST /keys/{set} Generate a new JSON Web Key
AdminApi createOAuth2Client POST /clients Create an OAuth 2.0 client
AdminApi deleteJsonWebKey DELETE /keys/{set}/{kid} Delete a JSON Web Key
AdminApi deleteJsonWebKeySet DELETE /keys/{set} Delete a JSON Web Key Set
AdminApi deleteOAuth2Client DELETE /clients/{id} Deletes an OAuth 2.0 Client
AdminApi flushInactiveOAuth2Tokens POST /oauth2/flush Flush Expired OAuth2 Access Tokens
AdminApi getConsentRequest GET /oauth2/auth/requests/consent Get consent request information
AdminApi getJsonWebKey GET /keys/{set}/{kid} Fetch a JSON Web Key
AdminApi getJsonWebKeySet GET /keys/{set} Retrieve a JSON Web Key Set
AdminApi getLoginRequest GET /oauth2/auth/requests/login Get an login request
AdminApi getLogoutRequest GET /oauth2/auth/requests/logout Get a logout request
AdminApi getOAuth2Client GET /clients/{id} Get an OAuth 2.0 Client.
AdminApi getVersion GET /version Get service version
AdminApi introspectOAuth2Token POST /oauth2/introspect Introspect OAuth2 tokens
AdminApi isInstanceAlive GET /health/alive Check alive status
AdminApi listOAuth2Clients GET /clients List OAuth 2.0 Clients
AdminApi listSubjectConsentSessions GET /oauth2/auth/sessions/consent Lists all consent sessions of a subject
AdminApi prometheus GET /metrics/prometheus Get snapshot metrics from the Hydra service. If you're using k8s, you can then add annotations to your deployment like so:
AdminApi rejectConsentRequest PUT /oauth2/auth/requests/consent/reject Reject an consent request
AdminApi rejectLoginRequest PUT /oauth2/auth/requests/login/reject Reject a login request
AdminApi rejectLogoutRequest PUT /oauth2/auth/requests/logout/reject Reject a logout request
AdminApi revokeAuthenticationSession DELETE /oauth2/auth/sessions/login Invalidates all login sessions of a certain user Invalidates a subject's authentication session
AdminApi revokeConsentSessions DELETE /oauth2/auth/sessions/consent Revokes consent sessions of a subject for a specific OAuth 2.0 Client
AdminApi updateJsonWebKey PUT /keys/{set}/{kid} Update a JSON Web Key
AdminApi updateJsonWebKeySet PUT /keys/{set} Update a JSON Web Key Set
AdminApi updateOAuth2Client PUT /clients/{id} Update an OAuth 2.0 Client
PublicApi disconnectUser GET /oauth2/sessions/logout OpenID Connect Front-Backchannel enabled Logout
PublicApi discoverOpenIDConfiguration GET /.well-known/openid-configuration OpenID Connect Discovery
PublicApi isInstanceReady GET /health/ready Check readiness status
PublicApi oauth2Token POST /oauth2/token The OAuth 2.0 token endpoint
PublicApi oauthAuth GET /oauth2/auth The OAuth 2.0 authorize endpoint
PublicApi revokeOAuth2Token POST /oauth2/revoke Revoke OAuth2 tokens
PublicApi userinfo GET /userinfo OpenID Connect Userinfo
PublicApi wellKnown GET /.well-known/jwks.json JSON Web Keys Discovery

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

basic

  • Type: HTTP basic authentication

oauth2

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: /oauth2/auth
  • Scopes:
    • offline: A scope required when requesting refresh tokens (alias for `offline`)
    • offline_access: A scope required when requesting refresh tokens
    • openid: Request an OpenID Connect ID Token

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.9%
  • Scala 0.1%