Sign inSign up

citizensadvice/mokta

By citizensadvice

Updated over 5 years ago

A mocked auth container

Image
1

50K+

citizensadvice/mokta repository overview

Mokta - Mock okta

Build

docker build -t citizensadvice/mokta .

Start

docker-compose up

# OR

docker-compose run -p 4001:4001 -v /path/to/custom/form:/app/form app

Visit http://localhost:4001/embed_uri

JWT claims

The family name and given name are automatically generated from the username. A sub is generated from the hash of the preferred username.

Like Okta, the domain @citizensadvice.org.uk is optional in the username.

Additional claims are generated from a custom form using the param claims.

Passwords are ignored as we are not testing Okta itself.

If an OTP_SECRET env is provided, 2FA will be enabled.

Example usage
version: "3"

services:
  app:
    build: .
    links:
      - okta:okta.test

  okta:
    image: citizensadvice/mokta
    ports: 4001:4001
    volumes: ./fixtures/okta:/app/data
    env_file: ./default.env
Testing
docker-compose run --rm app bundle exec rspec
Configuration
Key nameDescription
URL_HOSTThe parent app host and port
MOKTA_ISSUERThe issuer id must match the iss in your claims
AUTH_AUDIENCEThe audience claim
MOKTA_REDIRECT_URLThe URL to redirect to (POST) after login
OTP_SECRETIf present, enable OTP based 2fa

Tag summary

Content type

Image

Digest

Size

110.1 MB

Last updated

over 5 years ago

docker pull citizensadvice/mokta