Skip to content

Commit 52829d4

Browse files
committed
mapped user info and server config interceptors to only interactive portions of the site, closes mitreid-connect#1206
1 parent 903168a commit 52829d4

File tree

1 file changed

+35
-4
lines changed

1 file changed

+35
-4
lines changed

openid-connect-server-webapp/src/main/webapp/WEB-INF/application-context.xml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,41 @@
4444
</mvc:annotation-driven>
4545

4646
<mvc:interceptors>
47-
<!-- Inject the UserInfo into the response -->
48-
<bean id="userInfoInterceptor" class="org.mitre.openid.connect.web.UserInfoInterceptor" />
49-
<!-- Inject the server configuration into the response -->
50-
<bean id="serverConfigInterceptor" class="org.mitre.openid.connect.web.ServerConfigInterceptor" />
47+
<mvc:interceptor>
48+
<!-- Exclude APIs and other machine-facing endpoints from these interceptors -->
49+
<mvc:mapping path="/**" />
50+
<mvc:exclude-mapping path="/#{T(org.mitre.openid.connect.web.JWKSetPublishingEndpoint).URL}**" />
51+
<mvc:exclude-mapping path="/#{T(org.mitre.discovery.web.DiscoveryEndpoint).WELL_KNOWN_URL}/**" />
52+
<mvc:exclude-mapping path="/resources/**" />
53+
<mvc:exclude-mapping path="/token**"/>
54+
<mvc:exclude-mapping path="/#{T(org.mitre.openid.connect.web.DynamicClientRegistrationEndpoint).URL}/**" />
55+
<mvc:exclude-mapping path="/#{T(org.mitre.openid.connect.web.ProtectedResourceRegistrationEndpoint).URL}/**" />
56+
<mvc:exclude-mapping path="/#{T(org.mitre.openid.connect.web.UserInfoEndpoint).URL}**" />
57+
<mvc:exclude-mapping path="/#{T(org.mitre.openid.connect.web.RootController).API_URL}/**" />
58+
<mvc:exclude-mapping path="/#{T(org.mitre.oauth2.web.DeviceEndpoint).URL}/**" />
59+
<mvc:exclude-mapping path="/#{T(org.mitre.oauth2.web.IntrospectionEndpoint).URL}**" />
60+
<mvc:exclude-mapping path="/#{T(org.mitre.oauth2.web.RevocationEndpoint).URL}**" />
61+
62+
<!-- Inject the UserInfo into the response -->
63+
<bean id="userInfoInterceptor" class="org.mitre.openid.connect.web.UserInfoInterceptor" />
64+
</mvc:interceptor>
65+
<mvc:interceptor>
66+
<!-- Exclude APIs and other machine-facing endpoints from these interceptors -->
67+
<mvc:mapping path="/**" />
68+
<mvc:exclude-mapping path="/#{T(org.mitre.openid.connect.web.JWKSetPublishingEndpoint).URL}**" />
69+
<mvc:exclude-mapping path="/#{T(org.mitre.discovery.web.DiscoveryEndpoint).WELL_KNOWN_URL}/**" />
70+
<mvc:exclude-mapping path="/resources/**" />
71+
<mvc:exclude-mapping path="/token**"/>
72+
<mvc:exclude-mapping path="/#{T(org.mitre.openid.connect.web.DynamicClientRegistrationEndpoint).URL}/**" />
73+
<mvc:exclude-mapping path="/#{T(org.mitre.openid.connect.web.ProtectedResourceRegistrationEndpoint).URL}/**" />
74+
<mvc:exclude-mapping path="/#{T(org.mitre.openid.connect.web.UserInfoEndpoint).URL}**" />
75+
<mvc:exclude-mapping path="/#{T(org.mitre.openid.connect.web.RootController).API_URL}/**" />
76+
<mvc:exclude-mapping path="/#{T(org.mitre.oauth2.web.DeviceEndpoint).URL}/**" />
77+
<mvc:exclude-mapping path="/#{T(org.mitre.oauth2.web.IntrospectionEndpoint).URL}**" />
78+
<mvc:exclude-mapping path="/#{T(org.mitre.oauth2.web.RevocationEndpoint).URL}**" />
79+
<!-- Inject the server configuration into the response -->
80+
<bean id="serverConfigInterceptor" class="org.mitre.openid.connect.web.ServerConfigInterceptor" />
81+
</mvc:interceptor>
5182
</mvc:interceptors>
5283

5384
<mvc:default-servlet-handler />

0 commit comments

Comments
 (0)