Skip to content

Commit

Permalink
Extend/modify documentation of API
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtich committed Jan 12, 2021
1 parent f232899 commit 5fb26dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ The HTTP API and WebSocket allow client applications to interact with the login

The login server can further be used to authenticate users against other services so users can proof their identities.

[login-client](https://github.com/gbv/login-client) is a JavaScript browser library specifically made to interact with login-server. It is recommended to use it instead of working directly with the API. It can be seen in action [here](https://coli-conc.gbv.de/login/api) ([source for that site](https://github.com/gbv/login-server/blob/master/views/api.ejs)).

## Test
Tests use the same MongoDB as configured in `.env`, just with the postfix `-test` after the database name.

Expand Down Expand Up @@ -397,17 +395,14 @@ Callback endpoint for OAuth requests. Will save the connected identity to the us

## HTTP API

Before directly programming against HTTP API and [WebSocket API](#websocket) have a look at the [login-client](https://github.com/gbv/login-client) JavaScript browser library. It can be seen in action [here](https://coli-conc.gbv.de/login/api) ([source for that site](https://github.com/gbv/login-server/blob/master/views/api.ejs)).

### GET /about
Returns an object with keys `title` (title of the login-server instance), `env` (environment, like `development` or `production`), `publicKey` (usually a RSA public key), and `algorithm` (the [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) algorithm used). The corresponding private key to the given public key is used when signing JWTs.

### GET /providers
Returns a list of available providers (stripped off sensitive information).

### GET /users
Currently not available and undecided whether it will be removed.

<!-- Returns all users in database. If URL parameter `uri` is given, only users whose identities match one of the URIs are returned. Multiple URIs are separated by `|`. -->

### GET /currentUser
Returns the currently logged in user. Returns an 404 error when no user is logged in.

Expand Down
2 changes: 1 addition & 1 deletion views/api.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<h3>API Demo</h3>

<p><a href="https://github.com/gbv/login-server/blob/master/views/api.ejs" target="_blank">Demo Source</a></p>
<p>This page illustrates use of the <a href="https://github.com/gbv/login-server#http-api">HTTP API</a> and <a href="https://github.com/gbv/login-server#websocket">WebSocket API</a> (see also <a href="https://github.com/gbv/login-server/blob/master/views/api.ejs" target="_blank">demo sources</a>).</p>

<div class="container">
<div class="row demo">
Expand Down

0 comments on commit 5fb26dd

Please sign in to comment.