@@ -120,10 +120,15 @@ merge_openid_configuration(OpenId, OAuthProvider0) ->
120120 EndSessionEndpoint ->
121121 OAuthProvider2 # oauth_provider {end_session_endpoint = EndSessionEndpoint }
122122 end ,
123- case OpenId # openid_configuration .jwks_uri of
123+ OAuthProvider4 = case OpenId # openid_configuration .introspection_endpoint of
124124 undefined -> OAuthProvider3 ;
125+ IntrospectionEndpoint ->
126+ OAuthProvider3 # oauth_provider {introspection_endpoint = IntrospectionEndpoint }
127+ end ,
128+ case OpenId # openid_configuration .jwks_uri of
129+ undefined -> OAuthProvider4 ;
125130 JwksUri ->
126- OAuthProvider3 # oauth_provider {jwks_uri = JwksUri }
131+ OAuthProvider4 # oauth_provider {jwks_uri = JwksUri }
127132 end .
128133
129134-spec merge_oauth_provider (oauth_provider (), proplists :proplist ()) ->
@@ -144,10 +149,10 @@ merge_oauth_provider(OAuthProvider, Proplist) ->
144149 EndSessionEndpoint -> [{end_session_endpoint , EndSessionEndpoint } |
145150 proplists :delete (end_session_endpoint , Proplist1 )]
146151 end ,
147- Proplist3 = case OAuthProvider # oauth_provider .tokeninfo_endpoint of
152+ Proplist3 = case OAuthProvider # oauth_provider .introspection_endpoint of
148153 undefined -> Proplist2 ;
149- TokenInfoEndpoint -> [{tokeninfo_endpoint , TokenInfoEndpoint } |
150- proplists :delete (tokeninfo_endpoint , Proplist2 )]
154+ IntrospectionEndpoint -> [{introspection_endpoint , IntrospectionEndpoint } |
155+ proplists :delete (introspection_endpoint , Proplist2 )]
151156 end ,
152157 case OAuthProvider # oauth_provider .jwks_uri of
153158 undefined -> Proplist3 ;
@@ -181,6 +186,8 @@ map_to_openid_configuration(Map) ->
181186 Map , undefined ),
182187 end_session_endpoint = maps :get (? RESPONSE_END_SESSION_ENDPOINT ,
183188 Map , undefined ),
189+ introspection_endpoint = maps :get (? RESPONSE_INTROSPECTION_ENDPOINT ,
190+ Map , undefined ),
184191 jwks_uri = maps :get (? RESPONSE_JWKS_URI , Map , undefined )
185192 }.
186193
@@ -220,6 +227,10 @@ do_update_oauth_provider_endpoints_configuration(OAuthProvider) when
220227 undefined -> do_nothing ;
221228 EndSessionEndpoint -> set_env (end_session_endpoint , EndSessionEndpoint )
222229 end ,
230+ case OAuthProvider # oauth_provider .introspection_endpoint of
231+ undefined -> do_nothing ;
232+ IntrospectionEndpoint -> set_env (introspection_endpoint , IntrospectionEndpoint )
233+ end ,
223234 case OAuthProvider # oauth_provider .jwks_uri of
224235 undefined -> do_nothing ;
225236 JwksUri -> set_env (jwks_uri , JwksUri )
@@ -400,6 +411,7 @@ lookup_root_oauth_provider() ->
400411 token_endpoint = get_env (token_endpoint ),
401412 authorization_endpoint = get_env (authorization_endpoint ),
402413 end_session_endpoint = get_env (end_session_endpoint ),
414+ introspection_endpoint = get_env (introspection_endpoint ),
403415 ssl_options = extract_ssl_options_as_list (Map )
404416 }.
405417
@@ -589,6 +601,8 @@ map_to_oauth_provider(PropList) when is_list(PropList) ->
589601 proplists :get_value (authorization_endpoint , PropList , undefined ),
590602 end_session_endpoint =
591603 proplists :get_value (end_session_endpoint , PropList , undefined ),
604+ introspection_endpoint =
605+ proplists :get_value (introspection_endpoint , PropList , undefined ),
592606 jwks_uri =
593607 proplists :get_value (jwks_uri , PropList , undefined ),
594608 ssl_options =
@@ -639,13 +653,14 @@ format_oauth_provider(OAuthProvider) ->
639653 lists :flatten (io_lib :format (" {id: ~p , issuer: ~p , discovery_endpoint: ~p , " ++
640654 " token_endpoint: ~p , " ++
641655 " authorization_endpoint: ~p , end_session_endpoint: ~p , " ++
642- " jwks_uri: ~p , ssl_options: ~p }" , [
656+ " introspection_endpoint: ~p , jwks_uri: ~p , ssl_options: ~p }" , [
643657 format_oauth_provider_id (OAuthProvider # oauth_provider .id ),
644658 OAuthProvider # oauth_provider .issuer ,
645659 OAuthProvider # oauth_provider .discovery_endpoint ,
646660 OAuthProvider # oauth_provider .token_endpoint ,
647661 OAuthProvider # oauth_provider .authorization_endpoint ,
648662 OAuthProvider # oauth_provider .end_session_endpoint ,
663+ OAuthProvider # oauth_provider .introspection_endpoint ,
649664 OAuthProvider # oauth_provider .jwks_uri ,
650665 format_ssl_options (OAuthProvider # oauth_provider .ssl_options )])).
651666
0 commit comments