Maxkey v1.0 GA
Maxkey v1.0 GA
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package org.maxkey;
|
||||
|
||||
import org.maxkey.authz.oauth2.provider.endpoint.TokenEndpointAuthenticationFilter;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
@@ -20,4 +23,13 @@ public class MaxKeyConfig {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FilterRegistrationBean<TokenEndpointAuthenticationFilter> TokenEndpointAuthenticationFilter() {
|
||||
FilterRegistrationBean<TokenEndpointAuthenticationFilter> registration = new FilterRegistrationBean<TokenEndpointAuthenticationFilter>();
|
||||
registration.setFilter(new TokenEndpointAuthenticationFilter());
|
||||
registration.addUrlPatterns("/oauth/v20/token/*");
|
||||
registration.setName("TokenEndpointAuthenticationFilter");
|
||||
registration.setOrder(1);
|
||||
return registration;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class AppListController{
|
||||
AccountsService appUsersService;
|
||||
|
||||
@Autowired
|
||||
AppsService applicationsService;
|
||||
AppsService appsService;
|
||||
|
||||
@RequestMapping(value={"/appList"})
|
||||
public ModelAndView appList(@RequestParam(value="gridList",required = false) String gridList) {
|
||||
@@ -210,7 +210,7 @@ public class AppListController{
|
||||
@RequestParam("identity_password") String identity_password
|
||||
){
|
||||
|
||||
Apps app=applicationsService.get(appId);
|
||||
Apps app=appsService.get(appId);
|
||||
UserInfo userInfo=WebContext.getUserInfo();
|
||||
|
||||
Accounts appUsers=new Accounts();
|
||||
|
||||
@@ -37,9 +37,7 @@ public class ProfileController {
|
||||
@RequestMapping(value={"/myProfile"})
|
||||
public ModelAndView forwardBasic(){
|
||||
ModelAndView modelAndView=new ModelAndView("profile/myProfile");
|
||||
UserInfo userInfo=new UserInfo();
|
||||
userInfo.setId(WebContext.getUserInfo().getId());
|
||||
userInfo=userInfoService.load(userInfo);
|
||||
UserInfo userInfo=userInfoService.loadByUsername(WebContext.getUserInfo().getUsername());
|
||||
WebContext.getSession().setAttribute(userInfo.getId(), userInfo.getPicture());
|
||||
|
||||
// HashMap<String,Object>extraAttributeMap=new HashMap<String,Object>();
|
||||
|
||||
@@ -131,4 +131,5 @@
|
||||
</list>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -80,7 +80,7 @@
|
||||
<mvc:mapping path="/roles/*"/>
|
||||
<mvc:mapping path="/applications/*"/>
|
||||
<mvc:mapping path="/approles/*"/>
|
||||
<bean class="org.maxkey.web.interceptor.LogAdapter" />
|
||||
<bean class="org.maxkey.web.interceptor.HistoryLogsAdapter" />
|
||||
</mvc:interceptor>
|
||||
<!-- web Controller sso Adapter -->
|
||||
<mvc:interceptor>
|
||||
@@ -103,7 +103,7 @@
|
||||
<mvc:mapping path="/authz/tokenbased/*"/>
|
||||
<mvc:mapping path="/authz/saml20/idpinit/*"/>
|
||||
<mvc:mapping path="/authz/cas/granting"/>
|
||||
<bean class="org.maxkey.web.interceptor.LoginAppHistoryAdapter" />
|
||||
<bean class="org.maxkey.web.interceptor.HistoryLoginAppAdapter" />
|
||||
</mvc:interceptor>
|
||||
|
||||
|
||||
|
||||
@@ -5,10 +5,16 @@
|
||||
|
||||
.login_form_table{
|
||||
width:358px;
|
||||
border:0;
|
||||
}
|
||||
|
||||
.login_form_table td, .login_form_table th {
|
||||
padding: .2rem;
|
||||
vertical-align: top;
|
||||
border-top: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
#j_username,#j_password,#tfa_j_username,#tfa_j_password,#currentTime{
|
||||
width :230px;
|
||||
width :250px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -20,7 +26,7 @@
|
||||
}
|
||||
|
||||
#tfa_j_otp_captcha{
|
||||
width :100px;
|
||||
width :120px;
|
||||
/*width :230px;*/
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
<c:if test="${true == isExtendAttr}">
|
||||
<#if isExtendAttr >
|
||||
var attrIndex = 0;
|
||||
|
||||
function addExtendAttr(attribute,attributeValue){
|
||||
@@ -22,11 +22,11 @@
|
||||
attrIndex++;
|
||||
}
|
||||
|
||||
var extendAttrJson = eval("("+'${extendAttr}'+")");
|
||||
var extendAttrJson = eval("("+'${extendAttr!""}'+")");
|
||||
$.each(extendAttrJson,function(key,val){
|
||||
addExtendAttr(key,val);
|
||||
});
|
||||
</c:if>
|
||||
</#if>
|
||||
|
||||
$("#loginForm").submit();
|
||||
|
||||
|
||||
@@ -14,24 +14,12 @@
|
||||
<!-- oauth 2.0 -->
|
||||
<h2>Please Confirm OAuth 2.0</h2>
|
||||
|
||||
<p>You hereby authorize "${client.clientId}" to access your protected resources.</p>
|
||||
<p>You hereby authorize "${model.client.clientId!}" to access your protected resources.</p>
|
||||
<form id="confirmationForm" name="confirmationForm" action="<@base/>/oauth/v20/authorize" method="post">
|
||||
<input name="user_oauth_approval" value="true" type="hidden"/>
|
||||
|
||||
<ul>
|
||||
<#list model.scopes as scope>
|
||||
<c:set var="approved">
|
||||
<#if scope.value> checked</#if>
|
||||
</c:set>
|
||||
<c:set var="denied">
|
||||
<#if test="${!scope.value}"> checked</#if>
|
||||
</c:set>
|
||||
<li>
|
||||
${scope.key}:
|
||||
<input type="radio" name="${scope.key}" value="true"${approved}>Approve</input>
|
||||
<input type="radio" name="${scope.key}" value="false"${denied}>Deny</input>
|
||||
</li>
|
||||
</#list>
|
||||
|
||||
</ul>
|
||||
<label><input name="authorize" value="Authorize" type="submit"/></label>
|
||||
</form>
|
||||
|
||||
@@ -42,21 +42,21 @@
|
||||
<a href="<@base/>/profile/myProfile">我的资料</a>
|
||||
</li>
|
||||
<li id="nav_primay_15" class="nav_primay_level primaryleft" xpath="">
|
||||
<a href="<@base/>/logs/loginHistoryList">日志审计</a>
|
||||
<a href="<@base/>/historys/login">日志审计</a>
|
||||
<div id="nav_child_1501" class="nav_second_child">
|
||||
<ul>
|
||||
<li id="nav_second_1501" class="nav_second_level">
|
||||
<a href="<@base/>/logs/loginHistoryList">登录日志</a>
|
||||
<a href="<@base/>/historys/login">登录日志</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li id="nav_second_1502" class="nav_second_level">
|
||||
<a href="<@base/>/logs/loginAppHistoryList">访问日志</a>
|
||||
<a href="<@base/>/historys/loginApps">访问日志</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li id="nav_second_1503" class="nav_second_level">
|
||||
<a href="<@base/>/logs/list">操作日志</a>
|
||||
<a href="<@base/>/historys/logs">操作日志</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -187,7 +187,7 @@ $(function(){
|
||||
<div id="div_commonLogin" >
|
||||
<form id="loginForm" name="loginForm" action="<@base />/logon.do" method="post">
|
||||
<input type="hidden" name="j_auth_type" value="basic"/>
|
||||
<table class="login_form_table">
|
||||
<table class="table login_form_table">
|
||||
<tr>
|
||||
<td><@locale code="login.text.username"/>:</td>
|
||||
<td><input class="form-control" type='text' id='j_username' name='j_username' value="admin" tabindex="1"/></td>
|
||||
@@ -199,7 +199,7 @@ $(function(){
|
||||
<#if true==isCaptcha>
|
||||
<tr>
|
||||
<td><@locale code="login.text.captcha"/>:</td>
|
||||
<td><input class="form-control" type='text' id="j_captcha" name="j_captcha" tabindex="3" value="" /><img id="j_captchaimg" src="<@base/>/captcha"/></td>
|
||||
<td><input class="form-control" type='text' id="j_captcha" name="j_captcha" tabindex="3" value="" style="float: left;"/><img id="j_captchaimg" src="<@base/>/captcha"/></td>
|
||||
|
||||
</tr>
|
||||
</#if>
|
||||
@@ -226,7 +226,7 @@ $(function(){
|
||||
|
||||
</tr>
|
||||
<tr >
|
||||
<td colspan="2"><input id="loginSubmit" type="button" tabindex="5" style="width: 230px;" class="button btn btn-lg btn-primary btn-block" value="<@locale code="login.button.login"/>"/></td>
|
||||
<td colspan="2"><input id="loginSubmit" type="button" tabindex="5" style="width: 100%;" class="button btn btn-lg btn-primary btn-block" value="<@locale code="login.button.login"/>"/></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
@@ -255,7 +255,7 @@ $(function(){
|
||||
<tr>
|
||||
<td><@locale code="login.text.captcha"/>:</td>
|
||||
<td>
|
||||
<input class="form-control" type='text' id="tfa_j_otp_captcha" name="j_otp_captcha" tabindex="3" value="" />
|
||||
<input class="form-control" type='text' id="tfa_j_otp_captcha" name="j_otp_captcha" tabindex="3" value="" style="float: left;"/>
|
||||
<input class="form-control" id="tfa_j_otp_captcha_button" type="button" tabindex="5" class="button" value="获取动态验证码"/>
|
||||
|
||||
</td>
|
||||
@@ -290,7 +290,7 @@ $(function(){
|
||||
|
||||
</tr>
|
||||
<tr >
|
||||
<td colspan="2"><input id="tfa_loginSubmit" type="button" style="width: 230px;" tabindex="5" class="button btn btn-lg btn-primary btn-block" value="<@locale code="login.button.login"/>"/></td>
|
||||
<td colspan="2"><input id="tfa_loginSubmit" type="button" style="width: 100%;" tabindex="5" class="button btn btn-lg btn-primary btn-block" value="<@locale code="login.button.login"/>"/></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -55,8 +55,8 @@
|
||||
</td>
|
||||
<th rowspan="4"><@locale code="userinfo.picture" />:</th>
|
||||
<td rowspan="4">
|
||||
<#if null == model.picture >
|
||||
<img id="picture" width="150px" height="150px" src="<@base/>/images/uploadimage.jpg" />
|
||||
<#if model.picture? default("")=="" >
|
||||
<img id="picture" width="150px" height="150px" src="<@base/>/static/images/uploadimage.jpg" />
|
||||
<#else>
|
||||
<img id="picture" width="150px" height="150px" src="<@base/>/image/${model.id}" />
|
||||
</#if>
|
||||
|
||||
@@ -8,63 +8,34 @@
|
||||
<#include "../layout/top.ftl"/>
|
||||
<#include "../layout/nav_primary.ftl"/>
|
||||
<div class="container">
|
||||
<%if(WebContext.getUserInfo().getGridList()==0) {%>
|
||||
<table class="table">
|
||||
<c:forEach begin="1" end="${(fn:length(listSocialSignOnProvider)+3)/4}" var="num">
|
||||
<tr>
|
||||
<c:forEach items="${listSocialSignOnProvider}" var="socialSignOnProvider" begin="${(num-1)*4}" end="${4*num-1}">
|
||||
<#list listSocialSignOnProvider as socialSignOnProvider>
|
||||
<#if (socialSignOnProvider_index)%4==0>
|
||||
<tr>
|
||||
</#if>
|
||||
<td align="left" nowrap style="width:25%">
|
||||
<c:if test="${null!=socialSignOnProvider.provider}">
|
||||
<#if socialSignOnProvider.provider?default("")!="">
|
||||
<table class="none" style="width:100%;">
|
||||
<tr><td style="text-align: center;border-spacing: 0;border-collapse: collapse;border: 0px;">
|
||||
<img src="<s:Base />/${socialSignOnProvider.icon}" title="${socialSignOnProvider.providerName}" width="65px;" height="65px;"/>
|
||||
<img src="<@base />/static/${socialSignOnProvider.icon}" title="${socialSignOnProvider.providerName}" width="65px;" height="65px;"/>
|
||||
</td></tr>
|
||||
<tr><td style="text-align: center;border-spacing: 0;border-collapse: collapse;border: 0px;">${socialSignOnProvider.providerName}<div>
|
||||
<c:if test="${false==socialSignOnProvider.userBind}">
|
||||
<a href="<s:Base/>/logon/oauth20/bind/${socialSignOnProvider.provider}"><s:Locale code="login.social.link" /></a>
|
||||
</c:if>
|
||||
<c:if test="${true==socialSignOnProvider.userBind}">
|
||||
<a href="<s:Base/>/logon/oauth20//unbind/${socialSignOnProvider.provider}"><s:Locale code="login.social.unlink" /></a>
|
||||
</c:if>
|
||||
<#if false==socialSignOnProvider.userBind>
|
||||
<a href="<@base/>/logon/oauth20/bind/${socialSignOnProvider.provider}"><@locale code="login.social.link" /></a>
|
||||
</#if>
|
||||
<#if true==socialSignOnProvider.userBind>
|
||||
<a href="<@base />/logon/oauth20//unbind/${socialSignOnProvider.provider}"><@locale code="login.social.unlink" /></a>
|
||||
</#if>
|
||||
</div></td></tr>
|
||||
</table>
|
||||
</c:if>
|
||||
</#if>
|
||||
</td>
|
||||
</c:forEach>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
<#if (socialSignOnProvider_index +1)%4==0>
|
||||
</tr>
|
||||
</#if>
|
||||
</#list>
|
||||
</table>
|
||||
|
||||
<%}else{%>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td>
|
||||
<s:Locale code="login.social.icon"/>
|
||||
</td>
|
||||
<td><s:Locale code="login.social.provider"/></td>
|
||||
<td><s:Locale code="button.text.action"/></td>
|
||||
</tr>
|
||||
<c:forEach items="${listSocialSignOnProvider}" var="socialSignOnProvider">
|
||||
<c:if test="${null!=socialSignOnProvider.provider}">
|
||||
<tr>
|
||||
<td style="text-align: center;">
|
||||
<img src="<s:Base />/${socialSignOnProvider.icon}" title="${socialSignOnProvider.providerName}" width="60px;" height="64px;"/>
|
||||
</td>
|
||||
<td style="text-align: center;">${socialSignOnProvider.providerName}</td>
|
||||
<td style="text-align: center;">
|
||||
<c:if test="${false==socialSignOnProvider.userBind}">
|
||||
<a href="<s:Base/>/logon/oauth20/bind/${socialSignOnProvider.provider}"><s:Locale code="login.social.link" /></a>
|
||||
</c:if>
|
||||
<c:if test="${true==socialSignOnProvider.userBind}">
|
||||
<a href="<s:Base/>/logon/oauth20//unbind/${socialSignOnProvider.provider}"><s:Locale code="login.social.unlink" /></a>
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</table>
|
||||
<%} %>
|
||||
</div>
|
||||
</div >
|
||||
<div id="footer">
|
||||
<#include "../layout/footer.ftl"/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user