Skip to content

Commit 530fcfc

Browse files
Add tokeninfo_endpoint
1 parent 3c28315 commit 530fcfc

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

deps/oauth2_client/include/types.hrl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
issuer :: option(uri_string:uri_string()),
2626
discovery_endpoint :: option(uri_string:uri_string()),
2727
token_endpoint :: option(uri_string:uri_string()),
28+
tokeninfo_endpoint :: option(uri_string:uri_string()),
2829
authorization_endpoint :: option(uri_string:uri_string()),
2930
end_session_endpoint :: option(uri_string:uri_string()),
3031
jwks_uri :: option(uri_string:uri_string()),

deps/oauth2_client/src/oauth2_client.erl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,15 @@ merge_oauth_provider(OAuthProvider, Proplist) ->
144144
EndSessionEndpoint -> [{end_session_endpoint, EndSessionEndpoint} |
145145
proplists:delete(end_session_endpoint, Proplist1)]
146146
end,
147-
case OAuthProvider#oauth_provider.jwks_uri of
147+
Proplist3 = case OAuthProvider#oauth_provider.tokeninfo_endpoint of
148148
undefined -> Proplist2;
149+
TokenInfoEndpoint -> [{tokeninfo_endpoint, TokenInfoEndpoint} |
150+
proplists:delete(tokeninfo_endpoint, Proplist2)]
151+
end,
152+
case OAuthProvider#oauth_provider.jwks_uri of
153+
undefined -> Proplist3;
149154
JwksEndPoint -> [{jwks_uri, JwksEndPoint} |
150-
proplists:delete(jwks_uri, Proplist2)]
155+
proplists:delete(jwks_uri, Proplist3)]
151156
end.
152157

153158
parse_openid_configuration_response({error, Reason}) ->

deps/rabbitmq_auth_backend_oauth2/priv/schema/rabbitmq_auth_backend_oauth2.schema

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@
200200
rabbit_oauth2_schema:translate_endpoint_params("discovery_endpoint_params", Conf)
201201
end}.
202202

203+
{mapping,
204+
"auth_oauth2.tokeninfo_endpoint",
205+
"rabbitmq_auth_backend_oauth2.tokeninfo_endpoint",
206+
[{datatype, string}, {validators, ["uri", "https_uri"]}]}.
207+
203208
{mapping,
204209
"auth_oauth2.oauth_providers.$name.discovery_endpoint_params.$param",
205210
"rabbitmq_auth_backend_oauth2.oauth_providers",
@@ -291,6 +296,12 @@
291296
[{datatype, string}, {validators, ["uri", "https_uri"]}]
292297
}.
293298

299+
{mapping,
300+
"auth_oauth2.oauth_providers.$name.tokeninfo_endpoint",
301+
"rabbitmq_auth_backend_oauth2.oauth_providers",
302+
[{datatype, string}, {validators, ["uri", "https_uri"]}]
303+
}.
304+
294305
{mapping,
295306
"auth_oauth2.oauth_providers.$name.jwks_uri",
296307
"rabbitmq_auth_backend_oauth2.oauth_providers",

deps/rabbitmq_auth_backend_oauth2/src/rabbit_oauth2_schema.erl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ mapOauthProviderProperty({Key, Value}) ->
253253
{Key, case Key of
254254
issuer -> validator_https_uri(Key, Value);
255255
token_endpoint -> validator_https_uri(Key, Value);
256+
tokeninfo_endpoint -> validator_https_uri(Key, Value);
256257
jwks_uri -> validator_https_uri(Key, Value);
257258
end_session_endpoint -> validator_https_uri(Key, Value);
258259
authorization_endpoint -> validator_https_uri(Key, Value);

0 commit comments

Comments
 (0)