Oak IAM/IdP Server
Find a file
arne 851c138801
All checks were successful
API Doc Generation / generate_docs (push) Has been skipped
Kaocha Test Runner / run_kaocha (push) Successful in 2m13s
Build And Publish OCI Container / build (push) Successful in 2m36s
Merge pull request 'Password validation changes' (#7) from laurence/issue-5 into main
Reviewed-on: #7
2025-11-28 15:02:29 +00:00
.forgejo/workflows Disable apidoc job 2025-11-26 15:37:25 +01:00
.github/workflows Container CI setup 2025-10-08 14:18:32 +02:00
bin Uberjar already includes compilation 2025-11-28 15:54:48 +01:00
dev small touchups 2025-11-12 13:51:45 +01:00
docs 2FA refactoring / styling / follow-up 2025-10-22 13:23:12 +02:00
repl_sessions Get 2FA working in a basic manner 2025-10-29 13:25:54 +01:00
resources test WIP 2025-11-28 15:29:48 +01:00
src/co/gaiwan Version bumps and test harness stuff 2025-11-28 15:29:48 +01:00
test/co/gaiwan/oak Version bumps and test harness stuff 2025-11-28 15:29:48 +01:00
.editorconfig Add oakadm CLI, evolve schema, start on oauth stuff 2025-08-22 17:21:40 +02:00
.gitignore Add test harness, identifier test 2025-08-26 16:20:57 +02:00
bb.edn bumps 2025-09-30 07:53:43 +02:00
Containerfile Make sure container just works 2025-10-08 15:02:08 +02:00
deps.edn Version bumps and test harness stuff 2025-11-28 15:29:48 +01:00
docker-compose.yml Start work on password reset email, and some fixups 2025-10-23 12:34:59 +02:00
LICENSE.txt JOSE, logging, security providers, database setup 2025-08-17 09:16:15 +02:00
README.md YAGNI multipart form handling, maybe later 2025-11-27 10:04:21 +01:00
tests.edn kaocha config 2025-08-26 18:08:29 +02:00

Oak IAM

Rooted in Standards, Built to Last

Oak is a Free and Open Source Identity Provider that you can host yourself, it implements

  • OAuth 2.0
  • OpenID Connect
  • JWT with custom claims
  • Two-factor Authentication via TOTP (Time-Based One-Time Passwords)

Oak is headless, all administration and user management is done through a command line interface.

Getting Started

Dev

Start the application

echo '{:launchpad/aliases [:dev :test] :launchpad/options {:go true}}' > deps.local.edn
bin/launchpad

Initial setup

bin/oakadm jwk create
bin/oakadm oauth-client create --help
bin/oakadm oauth-client create --client-name "my-first-client"
bin/oakadm oauth-client create --client-name "foo" --redirect-uri 'https://example.com/redirect' --scope email --scope openid --scope offline_access
bin/oakadm user create --email foo@bar.com --password abc

Running in prod mode

When running from source, Oak assumes it runs in a dev environment, when deploying in production you want to make sure it uses the prod environment instead, which will affect configuration defaults. You can do this by setting the OAK__ENV=prod environment variable, or the oak.env=prod java system property. (-J-Doak.env=prod).

Future docker containers instead will default to prod, so they use sensible defaults for a production scenario.

Configuring the Database Connection

To connect to your database, you need to provide a configuration map under the :db/url, :db/username, and :db/password keys.

A basic configuration looks like this (this is the default configuration in dev, which matches the docker-compose setup):

{:db/url "jdbc:postgresql://localhost:15432/oak"
 :db/username "oak"
 :db/password "oak"}

Configuring Security Providers

You can dynamically register Java Cryptography Architecture (JCA) providers at runtime. This is useful for ensuring that your application uses a specific security provider, such as BouncyCastle for FIPS compliance, without modifying the JVM's java.security file.

Configuration is handled through two keys: :java.security.provider/prepend and :java.security.provider/append. The order of providers is significant; providers specified with :prepend will be given priority over existing and appended providers.

Both keys accept a collection of strings, where each string specifies a provider to be initialized. There are two supported formats for the provider string:

  1. className: For providers that can be initialized with a zero-argument constructor.

    • Example: "org.bouncycastle.jce.provider.BouncyCastleProvider"
  2. className/methodName: For providers that are initialized by calling a static, zero-argument method.

    • Example: "org.conscrypt.Conscrypt/newProvider"

Example Configuration

The following example demonstrates how to prepend the BouncyCastle provider (giving it the highest priority) and append the Conscrypt provider.

{:java.security.provider/prepend ["org.bouncycastle.jce.provider.BouncyCastleProvider"]
 :java.security.provider/append  ["org.conscrypt.Conscrypt/newProvider"]}

API docs

npx @redocly/cli build-docs 'http://127.0.0.1:4800/openapi.json'

License

Copyright © 2025 Arne Brasseur

All code in this project is made available under the Apache 2.0 license, unless specified otherwise. See LICENSE.txt.