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 39 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
748de7e
Add tokeninfo_endpoint
MarcialRosales May 29, 2025
3dc4b67
Add missing id tag
MarcialRosales May 29, 2025
7f37b91
Move changes from PR that created the spring auth server
MarcialRosales Jun 18, 2025
59c8ae7
Add binaries to deploy spring auth server
MarcialRosales Jun 18, 2025
bfe815d
Add introspection_endpoint to oauth2 schema
MarcialRosales Jun 18, 2025
a05cf1b
Fix typo and test case
MarcialRosales Jun 18, 2025
6b86a6b
Update settings in schema
MarcialRosales Jun 18, 2025
fd0f93d
Add function that detects if token is JWT
MarcialRosales Jun 18, 2025
eaa5512
Test resolve resource server with opaque access token
MarcialRosales Jun 18, 2025
dc8b9d2
Improve configuration of introspection
MarcialRosales Jun 18, 2025
d010ed9
Fix config test
MarcialRosales Jun 18, 2025
ffbfd91
Fix introspection_client_auth_method
MarcialRosales Jun 19, 2025
8ef2830
Move introspect token to oauth2_client
MarcialRosales Jun 19, 2025
9f52064
Fix unit test
MarcialRosales Jun 19, 2025
9893222
Add more tsets
MarcialRosales Jun 19, 2025
7dc7090
Fix first basic tests
MarcialRosales Jun 20, 2025
75d477f
Add more test coverage
MarcialRosales Jun 20, 2025
eb87453
Add function that will resolve an opaque token
MarcialRosales Jul 8, 2025
827fcf7
Remove funtion as not needed
MarcialRosales Jul 9, 2025
9dc629f
Remove statement
MarcialRosales Jul 9, 2025
afb2d94
Add selenium set for opaque tokens
MarcialRosales Jul 9, 2025
7c1ccf6
Fix issue and test invalid oapque tokens
MarcialRosales Jul 10, 2025
093eeb6
Remove not needed statement
MarcialRosales Jul 10, 2025
14bbee6
Fix access-token-format configuration
MarcialRosales Jul 10, 2025
b5f233f
Configure oauth2 client for mgt ui
MarcialRosales Jul 10, 2025
986311a
Opaque token working on management ui
MarcialRosales Jul 10, 2025
198adb8
Remove access_token_format
MarcialRosales Jul 11, 2025
77281d0
Added introspect endpoint
MarcialRosales Jul 12, 2025
4772572
Fix issues in endpoint
MarcialRosales Jul 15, 2025
bef581a
Successful unit test introspect token
MarcialRosales Jul 15, 2025
eaba341
Test active and non active opaque tokens
MarcialRosales Jul 15, 2025
56714f0
Test 401 condition
MarcialRosales Jul 15, 2025
6d0c409
Request introspection from management ui
MarcialRosales Jul 16, 2025
2c9ddc7
Add signing introspected token
MarcialRosales Jul 17, 2025
9b4dfbe
Use opaque signing key to validate incoming token
MarcialRosales Jul 17, 2025
40d2202
Fix issue signing token
MarcialRosales Jul 18, 2025
d6bf8fe
Successful login management ui with opaque token converted to JWT
MarcialRosales Jul 18, 2025
bf7476f
Remove log statements
MarcialRosales Jul 18, 2025
fbcd5a9
Migrate to new log api
MarcialRosales Jul 18, 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
2 changes: 1 addition & 1 deletion .github/workflows/test-management-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
if: ${{ failure() && steps.tests.outcome == 'failed' }}
uses: actions/[email protected]
env:
SELENIUM_ARTIFACTS: ${{ steps.run-suites.outputs.SELENIUM_ARTIFACTS }}
SELENIUM_ARTIFACTS: ${{ steps.tests.outputs.SELENIUM_ARTIFACTS }}
with:
name: test-artifacts-${{ matrix.browser }}-${{ matrix.erlang_version }}
path: |
Expand Down
2 changes: 1 addition & 1 deletion deps/oauth2_client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PROJECT = oauth2_client
PROJECT_DESCRIPTION = OAuth2 client from the RabbitMQ Project

BUILD_DEPS = rabbit
DEPS = rabbit_common jose
DEPS = rabbit_common jose base64url
TEST_DEPS = rabbitmq_ct_helpers cowboy
LOCAL_DEPS = ssl inets crypto public_key

Expand Down
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">>).
33 changes: 32 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,29 @@
}).

-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 :: integer(),
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()),
private_key :: option(binary()),
public_key :: option(binary())
}).
-type signing_key() :: #signing_key{}.
Loading
Loading