Skip to content

OAuth2: support opaque tokens #13978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 100 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
4dba062
Add tokeninfo_endpoint
MarcialRosales May 29, 2025
5ae77a0
Add missing id tag
MarcialRosales May 29, 2025
80673a3
Move changes from PR that created the spring auth server
MarcialRosales Jun 18, 2025
8adc38a
Add binaries to deploy spring auth server
MarcialRosales Jun 18, 2025
cf91fb3
Add introspection_endpoint to oauth2 schema
MarcialRosales Jun 18, 2025
d45d58b
Fix typo and test case
MarcialRosales Jun 18, 2025
0cd06ec
Update settings in schema
MarcialRosales Jun 18, 2025
5c72243
Add function that detects if token is JWT
MarcialRosales Jun 18, 2025
1a21afb
Test resolve resource server with opaque access token
MarcialRosales Jun 18, 2025
59d402f
Improve configuration of introspection
MarcialRosales Jun 18, 2025
333a591
Fix config test
MarcialRosales Jun 18, 2025
6f003d5
Fix introspection_client_auth_method
MarcialRosales Jun 19, 2025
5a9ffb0
Move introspect token to oauth2_client
MarcialRosales Jun 19, 2025
02d5fbb
Fix unit test
MarcialRosales Jun 19, 2025
ef3b267
Add more tsets
MarcialRosales Jun 19, 2025
02e1789
Fix first basic tests
MarcialRosales Jun 20, 2025
0e88d3d
Add more test coverage
MarcialRosales Jun 20, 2025
5e2e2b3
Add function that will resolve an opaque token
MarcialRosales Jul 8, 2025
0704fb2
Remove funtion as not needed
MarcialRosales Jul 9, 2025
86f0b99
Remove statement
MarcialRosales Jul 9, 2025
f3171a9
Add selenium set for opaque tokens
MarcialRosales Jul 9, 2025
e1d28a0
Fix issue and test invalid oapque tokens
MarcialRosales Jul 10, 2025
f628ebc
Remove not needed statement
MarcialRosales Jul 10, 2025
62c9884
Fix access-token-format configuration
MarcialRosales Jul 10, 2025
0e10902
Configure oauth2 client for mgt ui
MarcialRosales Jul 10, 2025
d2fa3ea
Opaque token working on management ui
MarcialRosales Jul 10, 2025
c17c7cc
Remove access_token_format
MarcialRosales Jul 11, 2025
f0645f9
Added introspect endpoint
MarcialRosales Jul 12, 2025
b4816ae
Fix issues in endpoint
MarcialRosales Jul 15, 2025
12bb2b3
Successful unit test introspect token
MarcialRosales Jul 15, 2025
685819c
Test active and non active opaque tokens
MarcialRosales Jul 15, 2025
e96beec
Test 401 condition
MarcialRosales Jul 15, 2025
6b623e7
Request introspection from management ui
MarcialRosales Jul 16, 2025
6bf758f
Add signing introspected token
MarcialRosales Jul 17, 2025
fd50d33
Use opaque signing key to validate incoming token
MarcialRosales Jul 17, 2025
f342ee1
Fix issue signing token
MarcialRosales Jul 18, 2025
8c670c5
Successful login management ui with opaque token converted to JWT
MarcialRosales Jul 18, 2025
9e22233
Remove log statements
MarcialRosales Jul 18, 2025
9ad0a3b
Migrate to new log api
MarcialRosales Jul 18, 2025
bb0fb5c
Include logging lib
MarcialRosales Jul 18, 2025
fb39517
Fix values to binary
MarcialRosales Jul 21, 2025
839e1f1
Fix configuration of opaque token signing key
MarcialRosales Jul 21, 2025
e7d6919
Fix schema test cases
MarcialRosales Jul 21, 2025
25959ef
Fix schema translation issue
MarcialRosales Jul 21, 2025
de9cba0
Fix bug
MarcialRosales Jul 21, 2025
1a045ac
Clean up code, fix dialyzer error
MarcialRosales Jul 21, 2025
0595fba
Fix dialyze errors
MarcialRosales Jul 22, 2025
c7c92f9
Fix dialyze errors
MarcialRosales Jul 22, 2025
6c83e24
Bump up time to wait for UAA to start
MarcialRosales Jul 22, 2025
7d2db4a
First commit to support opaque tokens for idp scenarios
MarcialRosales Jul 22, 2025
029395c
Move is_jwt_token to oauth2_client
MarcialRosales Jul 23, 2025
6e3ed5f
Support opaque token either via header or cookie
MarcialRosales Jul 23, 2025
168a772
Add test scenarios for oauth_bootstrap.js
MarcialRosales Jul 23, 2025
994115b
Test oauth_bootstrap.js with/out jwt/opaque token
MarcialRosales Jul 23, 2025
a46a203
Test jwt and opaque token via cookies
MarcialRosales Jul 23, 2025
f921bba
Fix test
MarcialRosales Jul 23, 2025
0a091d5
Fix dialyze error
MarcialRosales Jul 23, 2025
822dd85
Clean up
MarcialRosales Jul 23, 2025
d5e8ad2
Minmor clenup
MarcialRosales Jul 24, 2025
2c63009
Remove exported function
MarcialRosales Jul 24, 2025
b7da593
Remove unnecessary test
MarcialRosales Jul 24, 2025
3958865
Add extra line needed to env. files
MarcialRosales Jul 24, 2025
a7ceaa5
Add missing varaible
MarcialRosales Jul 24, 2025
a086552
Support opaque tokens when connection updates token
MarcialRosales Jul 24, 2025
5492f6b
Add missing system test
MarcialRosales Jul 29, 2025
56066ae
Fix bug updating secret when opaque token is invalid
MarcialRosales Jul 30, 2025
ae118b6
Fix unit test
MarcialRosales Jul 30, 2025
21a6bbe
Fix dialyzer error
MarcialRosales Jul 30, 2025
56c620f
Fix dialyzer error
MarcialRosales Jul 30, 2025
51a10ac
Test amqp+oauth+opaque tokens
MarcialRosales Jul 30, 2025
49c542a
Test opaque tokens via amqp protocol
MarcialRosales Jul 30, 2025
2621ceb
Send scope when requesting token
MarcialRosales Jul 30, 2025
488526f
Capture logs from selenium ci jobs
MarcialRosales Jul 30, 2025
49bb286
Fix reference to env var
MarcialRosales Jul 30, 2025
c6c8a3e
Fix location of spring ca certs for rabbitmq
MarcialRosales Jul 30, 2025
516bfec
Fix location of spring ca certs for selenium test
MarcialRosales Jul 30, 2025
b4f4fed
Exclude multi-oauth tests
MarcialRosales Jul 30, 2025
7086f56
Fix how to set path for output artifacts
MarcialRosales Jul 30, 2025
484ffba
Add log statement
MarcialRosales Jul 30, 2025
6d63c02
Wrap env var around curl braces
MarcialRosales Jul 30, 2025
11b64ef
Log IMAGE_TAG
MarcialRosales Jul 30, 2025
0b78b5b
Declare CONF_DIR_PREFIX on a different line
MarcialRosales Jul 30, 2025
3c29594
Generate env var for github before running test
MarcialRosales Jul 30, 2025
e28853e
Export env var before running tests
MarcialRosales Jul 31, 2025
224608e
Capture logs only when tests have failed
MarcialRosales Jul 31, 2025
08fb8a8
Test opaque token in ui as part of short ui suite
MarcialRosales Jul 31, 2025
98169a1
Fix ci job and generation of ssl certs
MarcialRosales Jul 31, 2025
6afac45
Add missing dedicate page for spring
MarcialRosales Jul 31, 2025
d5189ed
Add users required by oauth flows to spring
MarcialRosales Jul 31, 2025
93417dd
Fix issues using oauth2 with spring
MarcialRosales Aug 1, 2025
ae1a379
Revert wrong version of spring auth server
MarcialRosales Aug 1, 2025
b01590b
Allow SPRING_DOCKER_IMAGE to be configured externally
MarcialRosales Aug 1, 2025
538be8a
Bump up version of spring auth server
MarcialRosales Aug 1, 2025
282a738
Remove rabbitmq scopes from oauth client
MarcialRosales Aug 1, 2025
581ead4
Use 0.0.9 version of spring
MarcialRosales Aug 1, 2025
e1bdf49
Use a generic idp url rather than uaa
MarcialRosales Aug 4, 2025
b2629d0
Modify fakeportal so that it can talk to spring too
MarcialRosales Aug 4, 2025
9e63db8
Fix configuration for idp-initiated with opaque tokens
MarcialRosales Aug 4, 2025
256dba4
Use 0.0.10
MarcialRosales Aug 4, 2025
e8ca661
Add negative system tests for refresh opaque token
MarcialRosales Aug 4, 2025
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
22 changes: 12 additions & 10 deletions .github/workflows/test-authnz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,22 @@ jobs:
- name: Run Suites
id: tests
run: |
IMAGE_TAG=$(find PACKAGES/rabbitmq-server-generic-unix-*.tar.xz | awk -F 'PACKAGES/rabbitmq-server-generic-unix-|.tar.xz' '{print $2}')
CONF_DIR_PREFIX="$(mktemp -d)" RABBITMQ_DOCKER_IMAGE=pivotalrabbitmq/rabbitmq:$IMAGE_TAG \
${SELENIUM_DIR}/run-suites.sh full-suite-authnz-messaging
echo "SELENIUM_ARTIFACTS=$CONF_DIR_PREFIX" >> "$GITHUB_OUTPUT"

export IMAGE_TAG=$(find PACKAGES/rabbitmq-server-generic-unix-*.tar.xz | awk -F 'PACKAGES/rabbitmq-server-generic-unix-|.tar.xz' '{print $2}')
export CONF_DIR_PREFIX="$(mktemp -d)"
export RABBITMQ_DOCKER_IMAGE=pivotalrabbitmq/rabbitmq:$IMAGE_TAG
echo "Running selenium tests with "
echo " - CONF_DIR_PREFIX: ${CONF_DIR_PREFIX}"
echo " - IMAGE_TAG: ${IMAGE_TAG}"
echo " - RABBITMQ_DOCKER_IMAGE: ${RABBITMQ_DOCKER_IMAGE}"
echo "SELENIUM_ARTIFACTS=${CONF_DIR_PREFIX}" >> $GITHUB_ENV
${SELENIUM_DIR}/run-suites.sh full-suite-authnz-messaging

- name: Upload Test Artifacts
if: always()
if: ${{ failure() && steps.tests.outcome == 'failure' }}
uses: actions/[email protected]
env:
SELENIUM_ARTIFACTS: ${{ steps.tests.outputs.SELENIUM_ARTIFACTS }}
with:
name: test-artifacts-${{ matrix.browser }}-${{ matrix.erlang_version }}
path: |
$SELENIUM_ARTIFACTS/*
path: ${{ env.SELENIUM_ARTIFACTS }}/*

summary-selenium:
needs:
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/test-management-ui-for-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,19 @@ jobs:
- name: Run short UI suites on a standalone rabbitmq server
id: tests
run: |
IMAGE_TAG=$(find PACKAGES/rabbitmq-server-generic-unix-*.tar.xz | awk -F 'PACKAGES/rabbitmq-server-generic-unix-|.tar.xz' '{print $2}')
CONF_DIR_PREFIX="$(mktemp -d)" RABBITMQ_DOCKER_IMAGE=pivotalrabbitmq/rabbitmq:$IMAGE_TAG \
${SELENIUM_DIR}/run-suites.sh short-suite-management-ui
echo "SELENIUM_ARTIFACTS=$CONF_DIR_PREFIX" >> "$GITHUB_OUTPUT"

export IMAGE_TAG=$(find PACKAGES/rabbitmq-server-generic-unix-*.tar.xz | awk -F 'PACKAGES/rabbitmq-server-generic-unix-|.tar.xz' '{print $2}')
export CONF_DIR_PREFIX="$(mktemp -d)"
export RABBITMQ_DOCKER_IMAGE=pivotalrabbitmq/rabbitmq:$IMAGE_TAG
echo "Running selenium tests with "
echo " - CONF_DIR_PREFIX: ${CONF_DIR_PREFIX}"
echo " - IMAGE_TAG: ${IMAGE_TAG}"
echo " - RABBITMQ_DOCKER_IMAGE: ${RABBITMQ_DOCKER_IMAGE}"
echo "SELENIUM_ARTIFACTS=${CONF_DIR_PREFIX}" >> $GITHUB_ENV
${SELENIUM_DIR}/run-suites.sh short-suite-management-ui

- name: Upload Test Artifacts
if: ${{ failure() && steps.tests.outcome == 'failed' }}
if: ${{ failure() && steps.tests.outcome == 'failure' }}
uses: actions/upload-artifact@v4
env:
SELENIUM_ARTIFACTS: ${{ steps.tests.outputs.SELENIUM_ARTIFACTS }}
with:
name: test-artifacts-${{ matrix.browser }}-${{ matrix.erlang_version }}
path: |
$SELENIUM_ARTIFACTS/*
path: ${{ env.SELENIUM_ARTIFACTS }}/*
20 changes: 11 additions & 9 deletions .github/workflows/test-management-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,19 @@ jobs:
- name: Run full UI suite on a 3-node rabbitmq cluster
id: tests
run: |
IMAGE_TAG=$(find PACKAGES/rabbitmq-server-generic-unix-*.tar.xz | awk -F 'PACKAGES/rabbitmq-server-generic-unix-|.tar.xz' '{print $2}')
CONF_DIR_PREFIX="$(mktemp -d)" RABBITMQ_DOCKER_IMAGE=pivotalrabbitmq/rabbitmq:$IMAGE_TAG \
${SELENIUM_DIR}/run-suites.sh full-suite-management-ui
echo "SELENIUM_ARTIFACTS=$CONF_DIR_PREFIX" >> "$GITHUB_OUTPUT"
export IMAGE_TAG=$(find PACKAGES/rabbitmq-server-generic-unix-*.tar.xz | awk -F 'PACKAGES/rabbitmq-server-generic-unix-|.tar.xz' '{print $2}')
export CONF_DIR_PREFIX="$(mktemp -d)"
export RABBITMQ_DOCKER_IMAGE=pivotalrabbitmq/rabbitmq:$IMAGE_TAG
echo "Running selenium tests with "
echo " - CONF_DIR_PREFIX: ${CONF_DIR_PREFIX}"
echo " - IMAGE_TAG: ${IMAGE_TAG}"
echo " - RABBITMQ_DOCKER_IMAGE: ${RABBITMQ_DOCKER_IMAGE}"
echo "SELENIUM_ARTIFACTS=${CONF_DIR_PREFIX}" >> $GITHUB_ENV
${SELENIUM_DIR}/run-suites.sh full-suite-management-ui

- name: Upload Test Artifacts
if: ${{ failure() && steps.tests.outcome == 'failed' }}
if: ${{ failure() && steps.tests.outcome == 'failure' }}
uses: actions/[email protected]
env:
SELENIUM_ARTIFACTS: ${{ steps.run-suites.outputs.SELENIUM_ARTIFACTS }}
with:
name: test-artifacts-${{ matrix.browser }}-${{ matrix.erlang_version }}
path: |
$SELENIUM_ARTIFACTS/*
path: ${{ env.SELENIUM_ARTIFACTS }}/*
2 changes: 2 additions & 0 deletions deps/oauth2_client/include/oauth2_client.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
-define(REQUEST_CLIENT_SECRET, "client_secret").
-define(REQUEST_SCOPE, "scope").
-define(REQUEST_REFRESH_TOKEN, "refresh_token").
-define(REQUEST_TOKEN, "token").

% define access token response constants
-define(BEARER_TOKEN_TYPE, <<"Bearer">>).
Expand All @@ -43,5 +44,6 @@
-define(RESPONSE_TOKEN_ENDPOINT, <<"token_endpoint">>).
-define(RESPONSE_AUTHORIZATION_ENDPOINT, <<"authorization_endpoint">>).
-define(RESPONSE_END_SESSION_ENDPOINT, <<"end_session_endpoint">>).
-define(RESPONSE_INTROSPECTION_ENDPOINT, <<"introspection_endpoint">>).
-define(RESPONSE_JWKS_URI, <<"jwks_uri">>).
-define(RESPONSE_TLS_OPTIONS, <<"ssl_options">>).
31 changes: 30 additions & 1 deletion deps/oauth2_client/include/types.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
token_endpoint :: option(uri_string:uri_string()),
authorization_endpoint :: option(uri_string:uri_string()),
end_session_endpoint :: option(uri_string:uri_string()),
jwks_uri :: option(uri_string:uri_string())
jwks_uri :: option(uri_string:uri_string()),
introspection_endpoint :: option(uri_string:uri_string())
}).
-type openid_configuration() :: #openid_configuration{}.

Expand All @@ -28,6 +29,10 @@
authorization_endpoint :: option(uri_string:uri_string()),
end_session_endpoint :: option(uri_string:uri_string()),
jwks_uri :: option(uri_string:uri_string()),
introspection_endpoint :: option(uri_string:uri_string()),
introspection_client_id :: binary() | undefined,
introspection_client_secret :: binary() | undefined,
introspection_client_auth_method :: basic | request_param | undefined,
ssl_options :: option(list())
}).

Expand Down Expand Up @@ -73,3 +78,27 @@
}).

-type refresh_token_request() :: #refresh_token_request{}.

-record(introspect_token_request, {
endpoint :: option(uri_string:uri_string()),
client_id :: binary() | undefined,
client_secret :: binary() | undefined,
client_auth_method :: basic | request_param | undefined,
ssl_options :: option(list())
}).

-type introspect_token_request() :: #introspect_token_request{}.

-record(unsuccessful_introspect_token_response, {
error :: binary() | string() | number(),
error_description :: binary() | string() | undefined
}).

-type unsuccessful_introspect_token_response() :: #unsuccessful_introspect_token_response{}.

-record(signing_key, {
id :: string(),
type :: hs256 | rs256,
key :: option(#{binary() => binary()})
}).
-type signing_key() :: #signing_key{}.
Loading
Loading