Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jupyterhub/tmpauthenticator

JupyterHub authenticator that hands out temporary accounts for everyone. For use in tmpnb.org
https://github.com/jupyterhub/tmpauthenticator

authenticator jupyterhub tmpnb

Last synced: 4 days ago
JSON representation

JupyterHub authenticator that hands out temporary accounts for everyone. For use in tmpnb.org

Awesome Lists containing this project

README

        

# Temporary JupyterHub Authenticator

[![Latest PyPI version](https://img.shields.io/pypi/v/jupyterhub-tmpauthenticator?logo=pypi)](https://pypi.python.org/pypi/jupyterhub-tmpauthenticator)
[![GitHub Workflow Status - Test](https://img.shields.io/github/actions/workflow/status/jupyterhub/tmpauthenticator/test.yaml?logo=github&label=tests)](https://github.com/jupyterhub/tmpauthenticator/actions)
[![Test coverage of code](https://codecov.io/gh/jupyterhub/tmpauthenticator/branch/main/graph/badge.svg)](https://codecov.io/gh/jupyterhub/tmpauthenticator)
[![Issue tracking - GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/jupyterhub/tmpauthenticator/issues)
[![Help forum - Discourse](https://img.shields.io/badge/help_forum-discourse-blue?logo=discourse)](https://discourse.jupyter.org/c/jupyterhub)

Simple authenticator for [JupyterHub](http://github.com/jupyter/jupyterhub/)
that gives anyone who visits the home page a user account without having to
log in using any UI at all. It also spawns a single-user server and directs
the user to it immediately, without them having to press a button.

Built primarily to help run [tmpnb](https://github.com/jupyter/tmpnb) with JupyterHub.

## Installation

```
pip install jupyterhub-tmpauthenticator
```

Should install it. It has no additional dependencies beyond JupyterHub.

You can then use this as your authenticator by adding the following line to
your `jupyterhub_config.py`:

```python
c.JupyterHub.authenticator_class = "tmp"
```

## Configuration

`tmpauthenticator` does not have a lot of configurable knobs, but will respect
many relevant config options in the [base JupyterHub Authenticator class](https://jupyterhub.readthedocs.io/en/stable/reference/api/auth.html).
Here are a few that are particularly useful.

### `TmpAuthenticator.auto_login`

By default, `tmpauthenticator` will automatically log the user in as soon
as they hit the landing page of the JupyterHub, without showing them any UI.
This behavior can be turned off by setting `TmpAuthenticator.auto_login` to
`False`, allowing a home page to be shown. There will be a `Sign in` button here
that will automatically authenticate the user.

```python
c.TmpAuthenticator.auto_login = False
```

### `TmpAuthenticator.login_service`

If `auto_login` is set to `False`, the value of `TmpAuthenticator.login_service`
will determine the text shown next to `Sign in` in the default home page. It
defaults to `Automatic Temporary Credentials, so the button will read as
`Sign in with Automatic Temporary Credentials`.

```python
c.TmpAuthenticator.auto_login = False
c.TmpAuthenticator.login_service = "your inherent worth as a human being"
```