Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.

Commit 7877e18

Browse files
author
Dominik František Bučík
authored
Merge pull request #115 from CESNET/merge_controllers
refactor: Merged some controllers
2 parents 3cf3478 + e8b34f9 commit 7877e18

25 files changed

+577
-602
lines changed

perun-oidc-server-webapp/src/main/webapp/WEB-INF/application-context.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@
6565
<mvc:exclude-mapping path="/#{T(cz.muni.ics.openid.connect.web.ProtectedResourceRegistrationEndpoint).URL}/**" />
6666
<mvc:exclude-mapping path="/#{T(cz.muni.ics.openid.connect.web.UserInfoEndpoint).URL}**" />
6767
<mvc:exclude-mapping path="/#{T(cz.muni.ics.openid.connect.web.RootController).API_URL}/**" />
68-
<mvc:exclude-mapping path="/#{T(cz.muni.ics.oauth2.web.DeviceEndpoint).URL}/**" />
68+
<mvc:exclude-mapping path="#{T(cz.muni.ics.oauth2.web.DeviceEndpoint).ENDPOINT_URL}**" />
69+
<mvc:exclude-mapping path="#{T(cz.muni.ics.oauth2.web.DeviceEndpoint).REQUEST_USER_CODE_URL}**" />
70+
<mvc:exclude-mapping path="#{T(cz.muni.ics.oauth2.web.DeviceEndpoint).DEVICE_APPROVED_URL}**" />
6971
<mvc:exclude-mapping path="/#{T(cz.muni.ics.oauth2.web.IntrospectionEndpoint).URL}**" />
7072
<mvc:exclude-mapping path="/#{T(cz.muni.ics.oauth2.web.RevocationEndpoint).URL}**" />
71-
73+
7274
<!-- Inject the UserInfo into the response -->
7375
<ref bean="userInfoInterceptor"/>
7476
</mvc:interceptor>
@@ -83,7 +85,7 @@
8385
<mvc:exclude-mapping path="/#{T(cz.muni.ics.openid.connect.web.ProtectedResourceRegistrationEndpoint).URL}/**" />
8486
<mvc:exclude-mapping path="/#{T(cz.muni.ics.openid.connect.web.UserInfoEndpoint).URL}**" />
8587
<mvc:exclude-mapping path="/#{T(cz.muni.ics.openid.connect.web.RootController).API_URL}/**" />
86-
<mvc:exclude-mapping path="/#{T(cz.muni.ics.oauth2.web.DeviceEndpoint).URL}/**" />
88+
<mvc:exclude-mapping path="#{T(cz.muni.ics.oauth2.web.DeviceEndpoint).ENDPOINT_URL}**" />
8789
<mvc:exclude-mapping path="/#{T(cz.muni.ics.oauth2.web.IntrospectionEndpoint).URL}**" />
8890
<mvc:exclude-mapping path="/#{T(cz.muni.ics.oauth2.web.RevocationEndpoint).URL}**" />
8991
<!-- Inject the server configuration into the response -->
@@ -189,7 +191,7 @@
189191
<security:csrf disabled="true"/>
190192
</security:http>
191193

192-
<security:http pattern="/#{T(cz.muni.ics.oauth2.web.DeviceEndpoint).URL}/**"
194+
<security:http pattern="#{T(cz.muni.ics.oauth2.web.DeviceEndpoint).ENDPOINT_URL}**"
193195
use-expressions="true"
194196
entry-point-ref="oauthAuthenticationEntryPoint"
195197
create-session="stateless"

perun-oidc-server-webapp/src/main/webapp/WEB-INF/user-context.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
<mvc:exclude-mapping path="/#{T(cz.muni.ics.openid.connect.web.ProtectedResourceRegistrationEndpoint).URL}/**" />
4848
<mvc:exclude-mapping path="/#{T(cz.muni.ics.openid.connect.web.UserInfoEndpoint).URL}**" />
4949
<mvc:exclude-mapping path="/#{T(cz.muni.ics.openid.connect.web.RootController).API_URL}/**" />
50-
<mvc:exclude-mapping path="/#{T(cz.muni.ics.oauth2.web.DeviceEndpoint).URL}/**" />
50+
<mvc:exclude-mapping path="#{T(cz.muni.ics.oauth2.web.DeviceEndpoint).ENDPOINT_URL}**" />
51+
<mvc:exclude-mapping path="#{T(cz.muni.ics.oauth2.web.DeviceEndpoint).REQUEST_USER_CODE_URL}**" />
52+
<mvc:exclude-mapping path="#{T(cz.muni.ics.oauth2.web.DeviceEndpoint).DEVICE_APPROVED_URL}**" />
5153
<mvc:exclude-mapping path="/#{T(cz.muni.ics.oauth2.web.IntrospectionEndpoint).URL}**" />
5254
<mvc:exclude-mapping path="/#{T(cz.muni.ics.oauth2.web.RevocationEndpoint).URL}**" />
5355
<mvc:exclude-mapping path="#{T(cz.muni.ics.oidc.web.controllers.IsTestSpController).MAPPING}**" />
@@ -82,7 +84,7 @@
8284
<mvc:exclude-mapping path="/#{T(cz.muni.ics.openid.connect.web.ProtectedResourceRegistrationEndpoint).URL}/**" />
8385
<mvc:exclude-mapping path="/#{T(cz.muni.ics.openid.connect.web.UserInfoEndpoint).URL}**" />
8486
<mvc:exclude-mapping path="/#{T(cz.muni.ics.openid.connect.web.RootController).API_URL}/**" />
85-
<mvc:exclude-mapping path="/#{T(cz.muni.ics.oauth2.web.DeviceEndpoint).URL}/**" />
87+
<mvc:exclude-mapping path="#{T(cz.muni.ics.oauth2.web.DeviceEndpoint).ENDPOINT_URL}**" />
8688
<mvc:exclude-mapping path="/#{T(cz.muni.ics.oauth2.web.IntrospectionEndpoint).URL}**" />
8789
<mvc:exclude-mapping path="/#{T(cz.muni.ics.oauth2.web.RevocationEndpoint).URL}**" />
8890
<!-- Inject the server configuration into the response -->
@@ -495,13 +497,13 @@
495497
<!-- SAML -->
496498

497499
<bean id="clearSessionFilter" class="cz.muni.ics.oidc.saml.SamlInvalidateSessionFilter">
498-
<constructor-arg name="pattern" value="/authorize**"/>
499500
<constructor-arg name="oidcIssuer" value="${main.oidc.issuer.url}"/>
500501
<constructor-arg name="idpEntityId" value="${saml.idp.defaultIdpEntityId}"/>
501502
<constructor-arg name="proxySpEntityId" value="${saml.proxy.spEntityId}"/>
502503
<constructor-arg name="internalReferrers" value="#{'${saml.internalReferrers}'.split('\s*,\s*')}"/>
503504
<constructor-arg name="contextLogoutHandler" ref="logoutHandler"/>
504505
</bean>
506+
505507
<bean id="samlDiscovery" class="org.springframework.security.saml.SAMLDiscovery">
506508
<property name="contextProvider" ref="samlContextProvider"/>
507509
<property name="samlEntryPoint" ref="samlEntryPoint"/>

perun-oidc-server-webapp/src/main/webapp/WEB-INF/views/approveDevice.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</h1>
3838

3939
<form name="confirmationForm"
40-
action="${ config.issuer }${ config.issuer.endsWith('/') ? '' : '/' }device/approve" method="post">
40+
action="${ config.issuer }${ config.issuer.endsWith('/') ? '' : '/' }device/approved" method="post">
4141

4242
<div class="row">
4343
<div class="span5 offset1 well-small" style="text-align: left">

perun-oidc-server-webapp/src/main/webapp/WEB-INF/views/requestUserCode.jsp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@
3939
</c:if>
4040

4141

42-
<form action="${ config.issuer }${ config.issuer.endsWith('/') ? '' : '/' }device/verify" method="POST">
42+
<form action="${ config.issuer }${ config.issuer.endsWith('/') ? '' : '/' }device/code" method="POST">
4343

4444
<div class="row-fluid">
4545
<div class="span12">
4646
<spring:message code="device.request_code.submit" var="authorize_label"/>
4747
<div>
4848
<div class="input-block-level input-xlarge">
49-
<input type="text" name="user_code" placeholder="code" autocorrect="off" autocapitalize="off" autocomplete="off" spellcheck="false" value="" />
49+
<input type="text" name="user_code" placeholder="code" autocorrect="off"
50+
autocapitalize="off" autocomplete="off" spellcheck="false" value="${user_code}" />
5051
</div>
5152
</div>
5253
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />

perun-oidc-server-webapp/src/main/webapp/WEB-INF/views/themedApproveDevice.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<div id="content">
3434
<c:remove scope="session" var="SPRING_SECURITY_LAST_EXCEPTION" />
3535
<form name="confirmationForm"
36-
action="${ config.issuer }${ config.issuer.endsWith('/') ? '' : '/' }device/approve" method="post">
36+
action="${ config.issuer }${ config.issuer.endsWith('/') ? '' : '/' }device/approved" method="post">
3737
<p>
3838
<c:if test="${not empty client.policyUri}">
3939
<spring:message code="device_approve_privacy"/>${" "}<a target='_blank' href='${fn:escapeXml(client.policyUri)}'><em>${fn:escapeXml(client.clientName)}</em></a>

perun-oidc-server-webapp/src/main/webapp/WEB-INF/views/themedDeviceApproved.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pageContext.setAttribute("cssLinks", cssLinks);
4343
</c:if>
4444
${". "}<spring:message code="device_approved_text_rejected_end"/>
4545
</c:if>
46-
</p>q
46+
</p>
4747
</div>
4848

4949
</div> <%-- wrap --%>

perun-oidc-server-webapp/src/main/webapp/WEB-INF/views/themedRequestUserCode.jsp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@
5151
</c:otherwise>
5252
</c:choose>
5353

54-
<form name="confirmationForm" class="mt-2" method="post"
55-
action="${ config.issuer }${ config.issuer.endsWith('/') ? '' : '/' }device/verify">
54+
<form name="confirmationForm" class="mt-2" method="POST"
55+
action="${ config.issuer }${ config.issuer.endsWith('/') ? '' : '/' }device/code">
5656
<div class="row-fluid">
5757
<div class="span12">
5858
<div>
5959
<div class="input-block-level input-xlarge">
6060
<spring:message code="code" var="code_placeholder"/>
6161
<input type="text" name="user_code" placeholder="${code_placeholder}"
62-
autocapitalize="off" autocomplete="off" spellcheck="false" value="" />
62+
autocapitalize="off" autocomplete="off" spellcheck="false" value="${user_code}" />
6363
</div>
6464
</div>
6565
</div>

perun-oidc-server/src/main/java/cz/muni/ics/discovery/web/DiscoveryEndpoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ OPTIONAL. JSON array containing a list of the JWS signing algorithms (alg values
346346

347347
m.put("code_challenge_methods_supported", Lists.newArrayList(PKCEAlgorithm.plain.getName(), PKCEAlgorithm.S256.getName()));
348348

349-
m.put("device_authorization_endpoint", baseUrl + DeviceEndpoint.URL);
349+
m.put("device_authorization_endpoint", config.getIssuer(false) + DeviceEndpoint.ENDPOINT_URL);
350350

351351
model.addAttribute(JsonEntityView.ENTITY, m);
352352

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package cz.muni.ics.oauth2.model;
2+
3+
import lombok.Getter;
4+
import lombok.Setter;
5+
6+
import java.util.Set;
7+
8+
@Getter
9+
@Setter
10+
public class ClientWithScopes {
11+
12+
private ClientDetailsEntity client;
13+
private Set<String> requestedScopes;
14+
15+
}

0 commit comments

Comments
 (0)