Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM maven:3.8.5-openjdk-8
FROM maven:3.9-eclipse-temurin-25
EXPOSE 8080

RUN mkdir -p /authlete/app
Expand Down
10 changes: 8 additions & 2 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Production-friendly Dockerfile with multi-stage build and decent layer caching

FROM --platform=$BUILDPLATFORM maven:3.9.9-eclipse-temurin-21 AS builder
FROM --platform=$BUILDPLATFORM maven:3.9-eclipse-temurin-25 AS builder

WORKDIR /build
COPY pom.xml .
Expand All @@ -9,11 +9,17 @@ COPY src/ /build/src/
RUN mvn -Dmaven.test.skip=true -Dmaven.javadoc.skip=true package


FROM jetty:9.4.56-jre21-eclipse-temurin
FROM jetty:12.1.10-jdk25-eclipse-temurin

USER root
COPY certs/ certs/
RUN certs/import-certificate.sh certs/Open_Banking_Brasil_Sandbox_Root_G2.pem
USER jetty

# Jetty 12 deploys WARs through an EE environment module. This app targets
# Jakarta EE 10 (Servlet 6.0 / Jersey 3.1), so enable the ee10 deployer,
# annotation scanning and JSP support (used by the Jersey MVC pages).
RUN java -jar "$JETTY_HOME/start.jar" --add-modules=ee10-deploy,ee10-annotations,ee10-jsp

ENV JAVA_OPTIONS="$JAVA_OPTIONS -Djetty.httpConfig.requestHeaderSize=65536"
COPY --from=builder /build/target/*.war /var/lib/jetty/webapps/ROOT.war
35 changes: 24 additions & 11 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@

[OAuth 2.0][1] と [OpenID Connect][2] をサポートする認可サーバーの Java による実装です。

この実装は JAX-RS 2.0 API と [authlete-java-jaxrs][3] ライブラリを用いて書かれています。
JAX-RS は _The Java API for RESTful Web Services_ です。 JAX-RS 2.0 API は
[JSR 339][4] で標準化され、Java EE 7 に含まれています。 一方、authlete-java-jaxrs
は、認可サーバーとリソースサーバーを実装するためのユーティリティークラス群を提供するオープンソースライブラリです。
authlete-java-jaxrs は [authlete-java-common][5] ライブラリを使用しており、こちらは
この実装は Jakarta RESTful Web Services API (_Jakarta REST_、旧称 JAX-RS) と
[authlete-java-jakarta][3] ライブラリを用いて書かれています。 Jakarta REST は
[Jakarta EE][4] の一部です。 この認可サーバーは **Jakarta EE 10** スタック
(Jakarta REST 3.1 / Servlet 6.0、Jersey 3.1) を対象とし、**Java 25** でビルド・実行されます。
一方、authlete-java-jakarta は、認可サーバーとリソースサーバーを実装するためのユーティリティークラス群を提供するオープンソースライブラリです。
authlete-java-jakarta は [authlete-java-common][5] ライブラリを使用しており、こちらは
[Authlete Web API][6] とやりとりするためのオープンソースライブラリです。

> **注:** この認可サーバーは以前、レガシーな Java EE スタック
> (JAX-RS 2.0 / `javax.*`、Jersey 2、Servlet 3、Java 8) の上に構築されていました。
> 現在は **Jakarta EE 10** (`jakarta.*`) に移行しており、Tomcat 10+ や Jetty 12 などの
> 最新のサーブレットコンテナにそのままデプロイできます。 また、デフォルトの Authlete API
> バージョンも **Authlete 3.0** になりました (「設定ファイル」の節を参照)。

この実装は「DB レス」です。 これの意味するところは、認可データ (アクセストークン等)
や認可サーバー自体の設定、クライアントアプリケーション群の設定を保持するためのデータベースを用意する必要がないということです。
これは、[Authlete][7] をバックエンドサービスとして利用することにより実現しています。
Expand Down Expand Up @@ -69,7 +76,7 @@ API クレデンシャルズを取得する手順はとても簡単です。

$ vi authlete.properties

3. [maven][42] がインストールされていること、 `JAVA_HOME` が適切に設定されていることを確認します。
3. [maven][42] と **JDK 25** (以降) がインストールされていること、 `JAVA_HOME` が適切に設定されていることを確認します。

4. [http://localhost:8080][38] で認可サーバーを起動します。

Expand All @@ -89,6 +96,12 @@ Docker を利用する場合は, ステップ 2 の後に以下のコマンド

$ mvn -Dauthlete.configuration.file=local.authlete.properties jetty:run &

デフォルトでは `authlete.properties` は **Authlete 3.0** (API `V3`) 向けに設定されています。
サービスのクラスタの `base_url` (例: `https://jp.authlete.com`)、`service.api_key`、
および `service.access_token` を設定してください。 Authlete 2.x を引き続き使用する場合は、
ファイル内にコメントアウトされた「Authlete 2.x (legacy)」ブロックがあり、そちらに切り替えられます
(`https://api.authlete.com` 上で API キー + API シークレットを使用)。

エンドポイント
--------------

Expand Down Expand Up @@ -194,8 +207,8 @@ Authlete はユーザーアカウントを管理しないので、基本的に
----------------

この実装では、認可ページを実装するために `Viewable` クラスを使用しています。
このクラスは [Jersey][18] (JAX-RS の参照実装) に含まれているものですが、JAX-RS
2.0 API の一部ではありません。
このクラスは [Jersey][18] (Jakarta REST の参照実装) に含まれているものですが、Jakarta REST
API の一部ではありません。


関連仕様
Expand Down Expand Up @@ -232,7 +245,7 @@ Authlete はユーザーアカウントを管理しないので、基本的に

- [Authlete][7] - Authlete ホームページ
- [authlete-java-common][5] - Java 用 Authlete 共通ライブラリ
- [authlete-java-jaxrs][3] - JAX-RS (Java) 用 Authlete ライブラリ
- [authlete-java-jakarta][3] - Jakarta (Java) 用 Authlete ライブラリ
- [java-resource-server][40] - リソースサーバーの実装


Expand All @@ -249,8 +262,8 @@ Authlete はユーザーアカウントを管理しないので、基本的に

[1]: https://www.rfc-editor.org/rfc/rfc6749.html
[2]: https://openid.net/connect/
[3]: https://github.com/authlete/authlete-java-jaxrs
[4]: https://jcp.org/en/jsr/detail?id=339
[3]: https://github.com/authlete/authlete-java-jakarta
[4]: https://jakarta.ee/specifications/restful-ws/
[5]: https://github.com/authlete/authlete-java-common
[6]: https://docs.authlete.com/
[7]: https://www.authlete.com/
Expand Down
41 changes: 28 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@ Overview
This is an authorization server implementation in Java which supports
[OAuth 2.0][1] and [OpenID Connect][2].

This implementation is written using JAX-RS 2.0 API and [authlete-java-jaxrs][3]
library. JAX-RS is _The Java API for RESTful Web Services_. JAX-RS 2.0 API has
been standardized by [JSR 339][4] and it is included in Java EE 7. On the other
hand, authlete-java-jaxrs library is an open source library which provides utility
classes for developers to implement an authorization server and a resource server.
authlete-java-jaxrs in turn uses [authlete-java-common][5] library which is
another open source library to communicate with [Authlete Web APIs][6].
This implementation is written using the Jakarta RESTful Web Services API
(_Jakarta REST_, formerly known as JAX-RS) and the [authlete-java-jakarta][3]
library. Jakarta REST is part of [Jakarta EE][4]. This server targets the
**Jakarta EE 10** stack (Jakarta REST 3.1 / Servlet 6.0, Jersey 3.1) and builds
and runs on **Java 25**. On the other hand, authlete-java-jakarta library is an
open source library which provides utility classes for developers to implement an
authorization server and a resource server. authlete-java-jakarta in turn uses
[authlete-java-common][5] library which is another open source library to
communicate with [Authlete Web APIs][6].

> **Note:** This server was previously built on the legacy Java EE stack
> (JAX-RS 2.0 / `javax.*`, Jersey 2, Servlet 3, Java 8). It has been migrated to
> **Jakarta EE 10** (`jakarta.*`), so it now deploys cleanly to modern servlet
> containers such as Tomcat 10+ and Jetty 12. The default Authlete API version
> is also now **Authlete 3.0** (see [Configuration File](#configuration-file)).

This implementation is _DB-less_. What this means is that you don't have to
have a database server that stores authorization data (e.g. access tokens),
Expand Down Expand Up @@ -69,7 +77,8 @@ How To Run

$ vi authlete.properties

3. Make sure that you have installed [maven][42] and set `JAVA_HOME` properly.
3. Make sure that you have installed [maven][42] and a **JDK 25** (or later) and
set `JAVA_HOME` properly.

4. Start the authorization server on [http://localhost:8080][38].

Expand All @@ -89,6 +98,12 @@ the system property `authlete.configuration.file` like the following.

$ mvn -Dauthlete.configuration.file=local.authlete.properties jetty:run &

By default, `authlete.properties` is configured for **Authlete 3.0** (API `V3`):
set your service's cluster `base_url` (e.g. `https://jp.authlete.com`), the
`service.api_key` and a `service.access_token`. If you still use Authlete 2.x,
the file contains a commented "Authlete 2.x (legacy)" block you can switch to
(API key + API secret on `https://api.authlete.com`).


Endpoints
---------
Expand Down Expand Up @@ -201,8 +216,8 @@ Implementation Note
-------------------

This implementation uses `Viewable` class to implement the authorization page.
The class is included in [Jersey][18] (the reference implementation of JAX-RS),
but it is not a part of JAX-RS 2.0 API.
The class is included in [Jersey][18] (the reference implementation of Jakarta
REST), but it is not a part of the Jakarta REST API.


Related Specifications
Expand Down Expand Up @@ -239,7 +254,7 @@ See Also

- [Authlete][7] - Authlete Home Page
- [authlete-java-common][5] - Authlete Common Library for Java
- [authlete-java-jaxrs][3] - Authlete Library for JAX-RS (Java)
- [authlete-java-jakarta][3] - Authlete Library for Jakarta (Java)
- [java-resource-server][40] - Resource Server Implementation


Expand All @@ -256,8 +271,8 @@ Contact

[1]: https://www.rfc-editor.org/rfc/rfc6749.html
[2]: https://openid.net/connect/
[3]: https://github.com/authlete/authlete-java-jaxrs
[4]: https://jcp.org/en/jsr/detail?id=339
[3]: https://github.com/authlete/authlete-java-jakarta
[4]: https://jakarta.ee/specifications/restful-ws/
[5]: https://github.com/authlete/authlete-java-common
[6]: https://docs.authlete.com/
[7]: https://www.authlete.com/
Expand Down
76 changes: 47 additions & 29 deletions authlete.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,65 @@
# Source: https://github.com/authlete/authlete-java-common
# JavaDoc: http://authlete.github.io/authlete-java-common/
#
# This file is configured for Authlete 3.0 (API V3) by default. Authlete 3.0
# is the latest generation of Authlete and the version used for upcoming
# releases and updates. If you still rely on Authlete 2.x, see the
# "Authlete 2.x (legacy)" block near the bottom of this file.
#
#================================================================================


# api_version
#
# The Authlete API version. "V3" selects Authlete 3.0, which is the default
# for this authorization server.
#
api_version = V3


# base_url
#
# The base URL of the Authlete server. If you are using the shared server,
# set "https://api.authlete.com" to this parameter. On the other hand, if
# you are using a dedicated server, please contact "Authlete, Inc."
# The base URL of the Authlete server. For the Authlete 3.0 Shared Cloud,
# choose the URL of your service's cluster region:
#
# https://us.authlete.com - 🇺🇸 US Cluster
# https://jp.authlete.com - 🇯🇵 Japan Cluster
# https://eu.authlete.com - 🇪🇺 Europe Cluster
# https://br.authlete.com - 🇧🇷 Brazil Cluster
#
# If you are using a dedicated server, please contact "Authlete, Inc."
# <support@authlete.com> about the URL of your dedicated Authlete server.
#
base_url = https://api.authlete.com
base_url = https://us.authlete.com


# service.api_key
# service.api_secret
# service.access_token
#
# API credentials of one of your services. You can find API credentials of
# your services in Service Owner Console. The location of the management
# console is "https://so.authlete.com/" if you are using the shared server.
# On the other hand, if you are using a dedicated server, please contact
# "Authlete, Inc." <support@authlete.com> about the location of the
# management console of your dedicated Authlete server.
# Credentials of one of your services. With Authlete 3.0 (API V3), a service
# is identified by its API key and authenticated with an access token. You
# can find these in the Authlete management console
# (https://console.authlete.com/).
#
service.api_key =
service.access_token =


#--------------------------------------------------------------------------------
# Authlete 2.x (legacy)
#
# Earlier versions of this authorization server used Authlete 2.x. To use
# Authlete 2.x instead of 3.0, comment out the "api_version = V3" block above
# and uncomment the lines below.
#
# Authlete 2.x uses the shared server at https://api.authlete.com and
# authenticates a service with an API key + API secret pair. You can find
# these credentials in the Service Owner Console (https://so.authlete.com/).
#
# You can use "service.api_secret.encrypted" instead of "service.api_secret"
# to avoid writing a plain secret key in this configuration file. See the
# JavaDoc of AuthletePropertiesConfiguration for details.
#
service.api_key = 5593494639
service.api_secret = AAw0rner_-y1A6J9s20wjRCpkBvez3GxEBoL9jOJVR0

# For Authlete 3.0
#
# To use Authlete 3.0, you need to uncomment the block starting from the line "api_version = V3".
#
# The base_url should be selected based on your service's cluster region (for the Shared Cloud version):
# https://us.authlete.com - 🇺🇸 US Cluster
# https://jp.authlete.com - 🇯🇵 Japan Cluster
# https://eu.authlete.com - 🇪🇺 Europe Cluster
# https://br.authlete.com - 🇧🇷 Brazil Cluster
#
#api_version = V3
#base_url = https://<region>.authlete.com
#service.api_key = 986126671
#service.access_token =
#--------------------------------------------------------------------------------
#base_url = https://api.authlete.com
#service.api_key =
#service.api_secret =
Loading