Commit 8b1032c5 authored by Matija Obreza's avatar Matija Obreza
Browse files

Included OAuth client description and title in the authorization page

parent 825e4148
...@@ -5,39 +5,51 @@ ...@@ -5,39 +5,51 @@
<head> <head>
</head> </head>
<body> <body>
<c:set var="ex" value="${sessionScope['SPRING_SECURITY_LAST_EXCEPTION']}" /> <c:set var="ex" value="${sessionScope['SPRING_SECURITY_LAST_EXCEPTION']}" />
<c:if test="${ex != null}"> <c:if test="${ex != null}">
<div class="error"> <div class="error">
<h2>Oh no!</h2> <h2>Oh no!</h2>
<p>Access could not be granted</p> <p>Access could not be granted</p>
</div> </div>
</c:if> </c:if>
<c:remove scope="session" var="SPRING_SECURITY_LAST_EXCEPTION" /> <c:remove scope="session" var="SPRING_SECURITY_LAST_EXCEPTION" />
<security:authentication var="user" property="principal" /> <security:authentication var="user" property="principal" />
<security:authorize access="isAuthenticated()"> <security:authorize access="isAuthenticated()">
<h1><spring:message code="oauth2.confirm-request" /></h1> <h1>
<p> <spring:message code="oauth2.confirm-request" />
<spring:message code="oauth2.confirm-client" arguments="${user.user.name},${client.clientId}" htmlEscape="false" /> </h1>
</p> <p>
<spring:message code="oauth2.confirm-client" arguments="${user.user.name},${client.title}" htmlEscape="false" />
</p>
<div class="row"> <c:if test="${client.description ne null and client.description.length()>0}">
<div class="col-sm-2"> <div class="free-text" style="margin-bottom: 2em;">
<form action="<c:url value="/oauth/authorize" />" method="post"> <c:out value="${client.description}" escapeXml="false" />
<input name="user_oauth_approval" value="true" type="hidden" /> <label><input class="btn btn-primary" name="authorize" value="<spring:message code="oauth2.button-approve" />" type="submit" /></label> </div>
<!-- CSRF protection --> </c:if>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
</form> <div class="row">
</div> <div class="col-sm-2">
<div class="col-sm-2"> <form action="<c:url value="/oauth/authorize" />" method="post">
<form action="<c:url value="/oauth/authorize" />" method="post"> <input name="user_oauth_approval" value="true" type="hidden" /> <label><input class="btn btn-primary"
<input name="user_oauth_approval" value="false" type="hidden" /> <label><input class="btn btn-default" name="deny" value="<spring:message code="oauth2.button-deny" />" type="submit" /></label> name="authorize" value="<spring:message code="oauth2.button-approve" />" type="submit"
<!-- CSRF protection --> /></label>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/> <!-- CSRF protection -->
</form> <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
</div> </form>
</div> </div>
</security:authorize> <div class="col-sm-2">
<form action="<c:url value="/oauth/authorize" />" method="post">
<input name="user_oauth_approval" value="false" type="hidden" /> <label><input
class="btn btn-default" name="deny" value="<spring:message code="oauth2.button-deny" />" type="submit"
/></label>
<!-- CSRF protection -->
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
</form>
</div>
</div>
</security:authorize>
</body> </body>
</html> </html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment