mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-06 17:08:29 +08:00
Maxkey v1.0 GA
Maxkey v1.0 GA
This commit is contained in:
parent
b1e194ca0c
commit
c07aea5788
@ -1 +0,0 @@
|
||||
package org.maxkey.authn;
|
||||
@ -1,8 +0,0 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
package org.maxkey;
|
||||
@ -2,12 +2,12 @@ package org.maxkey.client.oauth.builder.api;
|
||||
|
||||
import org.maxkey.client.oauth.model.Token;
|
||||
|
||||
public class ConnsecApi10a extends DefaultApi10a
|
||||
public class MaxkeyApi10a extends DefaultApi10a
|
||||
{
|
||||
private static final String DEFAULT_WEB_URL = "http://sso.maxkey.org/maxkey";
|
||||
private static final String AUTHORIZATION_URL = DEFAULT_WEB_URL+"/oauth/v10a/authz?oauth_token=%s";
|
||||
|
||||
public ConnsecApi10a() {
|
||||
public MaxkeyApi10a() {
|
||||
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import org.maxkey.client.oauth.model.OAuthConfig;
|
||||
import org.maxkey.client.utils.HttpEncoder;
|
||||
import org.maxkey.client.utils.Preconditions;
|
||||
|
||||
public class ConnsecApi20 extends DefaultApi20 {
|
||||
public class MaxkeyApi20 extends DefaultApi20 {
|
||||
//approval_prompt:force or auto
|
||||
private static final String DEFAULT_WEB_URL = "http://sso.maxkey.org/maxkey";
|
||||
|
||||
@ -15,7 +15,7 @@ public class ConnsecApi20 extends DefaultApi20 {
|
||||
|
||||
private static final String SCOPED_AUTHORIZE_URL = String.format("%s&scope=%%s", AUTHORIZATION_URL);
|
||||
|
||||
public ConnsecApi20() {
|
||||
public MaxkeyApi20() {
|
||||
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ import org.maxkey.client.oauth.model.OAuthConfig;
|
||||
/**
|
||||
* OAuth 2.0 api.
|
||||
*/
|
||||
public class ConnsecPasswordApi20 extends DefaultApi20 {
|
||||
public class MaxkeyPasswordApi20 extends DefaultApi20 {
|
||||
|
||||
private String accessTokenUrl;
|
||||
private String grantType = "password";
|
||||
@ -19,7 +19,7 @@ public class ConnsecPasswordApi20 extends DefaultApi20 {
|
||||
|
||||
private static final String AUTHORIZE_PARAM = "&client_id=%s&client_secret=%s&username=%s&password=%s";
|
||||
|
||||
public ConnsecPasswordApi20(String accessTokenUrl) {
|
||||
public MaxkeyPasswordApi20(String accessTokenUrl) {
|
||||
super();
|
||||
this.accessTokenUrl = accessTokenUrl;
|
||||
}
|
||||
@ -45,7 +45,7 @@ public class OAuth10aServiceImpl implements OAuthService
|
||||
*/
|
||||
public OAuth10aServiceImpl(String clientId, String clientSecret,String redirectUri)
|
||||
{
|
||||
this.api = new ConnsecApi10a();
|
||||
this.api = new MaxkeyApi10a();
|
||||
this.config =new OAuthConfig(clientId,clientSecret,redirectUri);
|
||||
}
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ public class OAuth20ServiceImpl implements OAuthService
|
||||
*/
|
||||
public OAuth20ServiceImpl(String clientId, String clientSecret,String redirectUri)
|
||||
{
|
||||
this.api=new ConnsecApi20();
|
||||
this.api=new MaxkeyApi20();
|
||||
this.config =new OAuthConfig(clientId,clientSecret,redirectUri);
|
||||
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ package org.maxkey.client.oauth.oauth;
|
||||
import org.maxkey.client.http.HttpVerb;
|
||||
import org.maxkey.client.http.Response;
|
||||
import org.maxkey.client.oauth.builder.ServiceBuilder;
|
||||
import org.maxkey.client.oauth.builder.api.ConnsecPasswordApi20;
|
||||
import org.maxkey.client.oauth.builder.api.MaxkeyPasswordApi20;
|
||||
import org.maxkey.client.oauth.model.OAuthConfig;
|
||||
import org.maxkey.client.oauth.model.OAuthRequest;
|
||||
import org.maxkey.client.oauth.model.Token;
|
||||
@ -16,13 +16,13 @@ public class OAuthPasswordService {
|
||||
|
||||
private OAuthConfig config;
|
||||
|
||||
private ConnsecPasswordApi20 passwordApi20;
|
||||
private MaxkeyPasswordApi20 passwordApi20;
|
||||
|
||||
public OAuthPasswordService() {
|
||||
super();
|
||||
}
|
||||
|
||||
public OAuthPasswordService(OAuthConfig config,ConnsecPasswordApi20 passwordApi20) {
|
||||
public OAuthPasswordService(OAuthConfig config,MaxkeyPasswordApi20 passwordApi20) {
|
||||
super();
|
||||
this.passwordApi20=passwordApi20;
|
||||
this.config = config;
|
||||
@ -59,11 +59,11 @@ public class OAuthPasswordService {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
public ConnsecPasswordApi20 getPasswordApi20() {
|
||||
public MaxkeyPasswordApi20 getPasswordApi20() {
|
||||
return passwordApi20;
|
||||
}
|
||||
|
||||
public void setPasswordApi20(ConnsecPasswordApi20 passwordApi20) {
|
||||
public void setPasswordApi20(MaxkeyPasswordApi20 passwordApi20) {
|
||||
this.passwordApi20 = passwordApi20;
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.maxkey.client.oauth.OAuthClient;
|
||||
import org.maxkey.client.oauth.builder.ServiceBuilder;
|
||||
import org.maxkey.client.oauth.builder.api.ConnsecApi20;
|
||||
import org.maxkey.client.oauth.builder.api.MaxkeyApi20;
|
||||
import org.maxkey.client.oauth.domain.UserInfo;
|
||||
import org.maxkey.client.oauth.model.Token;
|
||||
import org.maxkey.client.oauth.model.Verifier;
|
||||
@ -88,7 +88,7 @@ public class AuthenticationFilter implements Filter {
|
||||
log.debug("enable : "+enable);
|
||||
|
||||
service = new ServiceBuilder()
|
||||
.provider(ConnsecApi20.class)
|
||||
.provider(MaxkeyApi20.class)
|
||||
.apiKey(this.clientId)
|
||||
.apiSecret(this.clientSecret)
|
||||
.callback(this.callBackUri)
|
||||
|
||||
@ -3,7 +3,7 @@ package com.connsec.client.oauth.test;
|
||||
import java.util.*;
|
||||
|
||||
import org.maxkey.client.oauth.builder.ServiceBuilder;
|
||||
import org.maxkey.client.oauth.builder.api.ConnsecApi10a;
|
||||
import org.maxkey.client.oauth.builder.api.MaxkeyApi10a;
|
||||
import org.maxkey.client.oauth.model.Token;
|
||||
import org.maxkey.client.oauth.oauth.OAuthService;
|
||||
|
||||
@ -15,7 +15,7 @@ public class Connsec10aExample
|
||||
public static void main(String[] args)
|
||||
{
|
||||
OAuthService service = new ServiceBuilder()
|
||||
.provider(ConnsecApi10a.class)
|
||||
.provider(MaxkeyApi10a.class)
|
||||
.apiKey("tonr-consumer-key")
|
||||
.apiSecret("SHHHHH!!!!!!!!!!")
|
||||
.callback(PROTECTED_RESOURCE_URL)
|
||||
|
||||
@ -5,7 +5,7 @@ import java.util.*;
|
||||
import org.maxkey.client.http.HttpVerb;
|
||||
import org.maxkey.client.http.Response;
|
||||
import org.maxkey.client.oauth.builder.ServiceBuilder;
|
||||
import org.maxkey.client.oauth.builder.api.ConnsecApi10a;
|
||||
import org.maxkey.client.oauth.builder.api.MaxkeyApi10a;
|
||||
import org.maxkey.client.oauth.model.OAuthRequest;
|
||||
import org.maxkey.client.oauth.model.Token;
|
||||
import org.maxkey.client.oauth.model.Verifier;
|
||||
@ -19,7 +19,7 @@ public class Connsec10aVerifierExample
|
||||
public static void main(String[] args)
|
||||
{
|
||||
OAuthService service = new ServiceBuilder()
|
||||
.provider(ConnsecApi10a.class)
|
||||
.provider(MaxkeyApi10a.class)
|
||||
.apiKey("tonr-consumer-key")
|
||||
.apiSecret("SHHHHH!!!!!!!!!!")
|
||||
.callback(PROTECTED_RESOURCE_URL)
|
||||
|
||||
@ -5,7 +5,7 @@ import java.util.*;
|
||||
import org.maxkey.client.http.HttpVerb;
|
||||
import org.maxkey.client.http.Response;
|
||||
import org.maxkey.client.oauth.builder.ServiceBuilder;
|
||||
import org.maxkey.client.oauth.builder.api.ConnsecApi20;
|
||||
import org.maxkey.client.oauth.builder.api.MaxkeyApi20;
|
||||
import org.maxkey.client.oauth.model.OAuthRequest;
|
||||
import org.maxkey.client.oauth.model.Token;
|
||||
import org.maxkey.client.oauth.model.Verifier;
|
||||
@ -23,7 +23,7 @@ public class Connsec20Example
|
||||
String apiKey = "your_api_key";
|
||||
String apiSecret = "your_api_secret";
|
||||
OAuthService service = new ServiceBuilder()
|
||||
.provider(ConnsecApi20.class)
|
||||
.provider(MaxkeyApi20.class)
|
||||
.apiKey(apiKey)
|
||||
.apiSecret(apiSecret)
|
||||
.callback("http://www.dajie.com/oauth/sina")
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.connsec.client.oauth.test;
|
||||
|
||||
import org.maxkey.client.http.Response;
|
||||
import org.maxkey.client.oauth.builder.api.ConnsecPasswordApi20;
|
||||
import org.maxkey.client.oauth.builder.api.MaxkeyPasswordApi20;
|
||||
import org.maxkey.client.oauth.model.OAuthConfig;
|
||||
import org.maxkey.client.oauth.model.Token;
|
||||
import org.maxkey.client.oauth.oauth.OAuthPasswordService;
|
||||
@ -23,7 +23,7 @@ public class ConnsecPasswordDemo {
|
||||
String approvalprompt = "auto";
|
||||
OAuthConfig oauthServiceConfig=new OAuthConfig(clientId,clientSerect,callback);
|
||||
|
||||
ConnsecPasswordApi20 ConnsecPasswordApi20=new ConnsecPasswordApi20(accessTokenUrl);
|
||||
MaxkeyPasswordApi20 ConnsecPasswordApi20=new MaxkeyPasswordApi20(accessTokenUrl);
|
||||
|
||||
OAuthPasswordService oAuthPasswordService=new OAuthPasswordService(oauthServiceConfig,ConnsecPasswordApi20);
|
||||
Token accessToken = null;
|
||||
|
||||
@ -17,7 +17,7 @@ import org.maxkey.domain.apps.Apps;
|
||||
MENUID varchar(40) null
|
||||
constraint PK_ROLES primary key clustered (ID)
|
||||
*/
|
||||
@Table(name = "GROUP_APP")
|
||||
@Table(name = "GROUP_PRIVILEGES")
|
||||
public class GroupPrivileges extends Apps implements Serializable{
|
||||
|
||||
/**
|
||||
|
||||
@ -16,6 +16,8 @@ public interface UserInfoMapper extends IJpaBaseMapper<UserInfo>{
|
||||
|
||||
public int logisticDeleteAllByCid(String cid);
|
||||
|
||||
public UserInfo loadByUsername(String username);
|
||||
|
||||
public void locked(UserInfo userInfo);
|
||||
|
||||
public void unlock(UserInfo userInfo);
|
||||
|
||||
@ -75,6 +75,9 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
|
||||
return false;
|
||||
}
|
||||
|
||||
public UserInfo loadByUsername(String username) {
|
||||
return getMapper().loadByUsername(username);
|
||||
}
|
||||
|
||||
public UserInfo loadByAppIdAndUsername(String appId,String username){
|
||||
try {
|
||||
|
||||
@ -6,10 +6,10 @@
|
||||
SELECT DISTINCT
|
||||
APP.*
|
||||
FROM
|
||||
APPLICATIONS APP,GROUP_APP GA
|
||||
APPS APP,GROUP_PRIVILEGES GP
|
||||
WHERE
|
||||
APP.ID=GA.APPID
|
||||
AND GA.GROUPID IN(
|
||||
APP.ID=GP.APPID
|
||||
AND GP.GROUPID IN(
|
||||
SELECT
|
||||
G.ID
|
||||
FROM
|
||||
@ -34,7 +34,7 @@
|
||||
<if test="name != null and name != ''">
|
||||
AND NAME = #{name}
|
||||
</if>
|
||||
ORDER BY SORTORDER
|
||||
ORDER BY SORTINDEX
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -2,6 +2,14 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.maxkey.dao.persistence.UserInfoMapper">
|
||||
|
||||
<select id="loadByUsername" parameterType="string" resultType="UserInfo">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
USERINFO
|
||||
WHERE USERNAME = #{value}
|
||||
</select>
|
||||
|
||||
<select id="queryPageResults" parameterType="UserInfo" resultType="UserInfo">
|
||||
SELECT
|
||||
ID,
|
||||
|
||||
@ -6,6 +6,7 @@ package org.maxkey.authz.cas.endpoint;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.maxkey.authn.BasicAuthentication;
|
||||
import org.maxkey.authz.cas.endpoint.response.Service10ResponseBuilder;
|
||||
import org.maxkey.authz.cas.endpoint.ticket.CasConstants;
|
||||
import org.maxkey.authz.cas.endpoint.ticket.Ticket;
|
||||
@ -89,8 +90,10 @@ renew [OPTIONAL] - if this parameter is set, ticket validation will only succeed
|
||||
}
|
||||
|
||||
if(storedTicket!=null){
|
||||
String principal=((BasicAuthentication)storedTicket.getAuthentication().getPrincipal()).getJ_username();
|
||||
_logger.debug("principal "+principal);
|
||||
return new Service10ResponseBuilder().success()
|
||||
.setUser(storedTicket.getAuthentication().getPrincipal().toString())
|
||||
.setUser(principal)
|
||||
.serviceResponseBuilder();
|
||||
}else{
|
||||
return new Service10ResponseBuilder().failure()
|
||||
|
||||
@ -6,6 +6,7 @@ package org.maxkey.authz.cas.endpoint;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.maxkey.authn.BasicAuthentication;
|
||||
import org.maxkey.authz.cas.endpoint.response.ProxyServiceResponseBuilder;
|
||||
import org.maxkey.authz.cas.endpoint.response.ServiceResponseBuilder;
|
||||
import org.maxkey.authz.cas.endpoint.ticket.CasConstants;
|
||||
@ -189,14 +190,13 @@ For all error codes, it is RECOMMENDED that CAS provide a more detailed message
|
||||
ServiceResponseBuilder serviceResponseBuilder=new ServiceResponseBuilder();
|
||||
|
||||
if(storedTicket!=null){
|
||||
String principal=storedTicket.getAuthentication().getPrincipal().toString();
|
||||
String principal=((BasicAuthentication)storedTicket.getAuthentication().getPrincipal()).getJ_username();
|
||||
_logger.debug("principal "+principal);
|
||||
serviceResponseBuilder.success().setUser(principal);
|
||||
|
||||
if(BOOLEAN.isTrue(storedTicket.getCasDetails().getIsAdapter())){
|
||||
AbstractAuthorizeAdapter adapter =(AbstractAuthorizeAdapter)Instance.newInstance(storedTicket.getCasDetails().getAdapter());
|
||||
UserInfo queryUserInfo=new UserInfo();
|
||||
queryUserInfo.setUsername(principal);
|
||||
UserInfo userInfo = (UserInfo) userInfoService.load(queryUserInfo);
|
||||
UserInfo userInfo = (UserInfo) userInfoService.loadByUsername(principal);
|
||||
adapter.generateInfo(userInfo, serviceResponseBuilder);
|
||||
}
|
||||
}else{
|
||||
|
||||
@ -6,6 +6,7 @@ package org.maxkey.authz.cas.endpoint;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.maxkey.authn.BasicAuthentication;
|
||||
import org.maxkey.authz.cas.endpoint.response.ServiceResponseBuilder;
|
||||
import org.maxkey.authz.cas.endpoint.ticket.CasConstants;
|
||||
import org.maxkey.authz.cas.endpoint.ticket.Ticket;
|
||||
@ -70,14 +71,12 @@ public class Cas30AuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
ServiceResponseBuilder serviceResponseBuilder=new ServiceResponseBuilder();
|
||||
|
||||
if(storedTicket!=null){
|
||||
String principal=storedTicket.getAuthentication().getPrincipal().toString();
|
||||
String principal=((BasicAuthentication)storedTicket.getAuthentication().getPrincipal()).getJ_username();
|
||||
serviceResponseBuilder.success().setUser(principal);
|
||||
|
||||
if(BOOLEAN.isTrue(storedTicket.getCasDetails().getIsAdapter())){
|
||||
AbstractAuthorizeAdapter adapter =(AbstractAuthorizeAdapter)Instance.newInstance(storedTicket.getCasDetails().getAdapter());
|
||||
UserInfo queryUserInfo=new UserInfo();
|
||||
queryUserInfo.setUsername(principal);
|
||||
UserInfo userInfo = (UserInfo) userInfoService.load(queryUserInfo);
|
||||
UserInfo userInfo = (UserInfo) userInfoService.loadByUsername(principal);
|
||||
adapter.generateInfo(userInfo, serviceResponseBuilder);
|
||||
}
|
||||
}else{
|
||||
@ -112,14 +111,12 @@ public class Cas30AuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
ServiceResponseBuilder serviceResponseBuilder=new ServiceResponseBuilder();
|
||||
|
||||
if(storedTicket!=null){
|
||||
String principal=storedTicket.getAuthentication().getPrincipal().toString();
|
||||
String principal=((BasicAuthentication)storedTicket.getAuthentication().getPrincipal()).getJ_username();
|
||||
serviceResponseBuilder.success().setUser(principal);
|
||||
|
||||
if(BOOLEAN.isTrue(storedTicket.getCasDetails().getIsAdapter())){
|
||||
AbstractAuthorizeAdapter adapter =(AbstractAuthorizeAdapter)Instance.newInstance(storedTicket.getCasDetails().getAdapter());
|
||||
UserInfo queryUserInfo=new UserInfo();
|
||||
queryUserInfo.setUsername(principal);
|
||||
UserInfo userInfo = (UserInfo) userInfoService.load(queryUserInfo);
|
||||
UserInfo userInfo = (UserInfo) userInfoService.loadByUsername(principal);
|
||||
adapter.generateInfo(userInfo, serviceResponseBuilder);
|
||||
}
|
||||
}else{
|
||||
|
||||
@ -69,7 +69,7 @@ public class CasAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
HttpServletResponse response,
|
||||
@PathVariable("id") String id){
|
||||
|
||||
AppsCasDetails casDetails=casDetailsService.get(id);
|
||||
AppsCasDetails casDetails=casDetailsService.getAppDetails(id);
|
||||
|
||||
return buildCasModelAndView(casDetails);
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ public class DesktopAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
public ModelAndView authorize(
|
||||
HttpServletRequest request,
|
||||
@PathVariable("id") String id){
|
||||
AppsDesktopDetails desktopDetails=desktopDetailsService.get(id);
|
||||
AppsDesktopDetails desktopDetails=desktopDetailsService.getAppDetails(id);
|
||||
_logger.debug(""+desktopDetails);
|
||||
|
||||
Accounts appUser=getAccounts(desktopDetails);
|
||||
|
||||
@ -40,7 +40,7 @@ public class FormBasedAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
public ModelAndView authorize(
|
||||
HttpServletRequest request,
|
||||
@PathVariable("id") String id){
|
||||
AppsFormBasedDetails formBasedDetails=formBasedDetailsService.get(id);
|
||||
AppsFormBasedDetails formBasedDetails=formBasedDetailsService.getAppDetails(id);
|
||||
_logger.debug(""+formBasedDetails);
|
||||
Apps application= getApp(id);
|
||||
formBasedDetails.setAdapter(application.getAdapter());
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="bin/main" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="gradle_scope" value="main"/>
|
||||
<attribute name="gradle_used_by_scope" value="main,test"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
|
||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
||||
<classpathentry kind="output" path="bin/default"/>
|
||||
</classpath>
|
||||
@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>maxkey-protocol-ltpa</name>
|
||||
<comment>maxkey-protocol-ltpa</comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@ -1,10 +0,0 @@
|
||||
build.commands=org.eclipse.jdt.core.javabuilder
|
||||
connection.arguments=
|
||||
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
|
||||
connection.java.home=null
|
||||
connection.jvm.arguments=
|
||||
containers=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7/
|
||||
derived.resources=.gradle,build
|
||||
eclipse.preferences.version=1
|
||||
natures=org.eclipse.jdt.core.javanature
|
||||
project.path=\:maxkey-protocols\:maxkey-protocol-ltpa
|
||||
@ -1,2 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
@ -1,16 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
|
||||
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
|
||||
org.eclipse.jdt.core.builder.invalidClasspath=abort
|
||||
org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
|
||||
org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
|
||||
org.eclipse.jdt.core.circularClasspath=warning
|
||||
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
|
||||
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
|
||||
org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
|
||||
org.eclipse.jdt.core.incompleteClasspath=error
|
||||
@ -1,2 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning
|
||||
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="maxkey-protocol-ltpa">
|
||||
<wb-resource deploy-path="/" source-path="/src/main/java"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
||||
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="java"/>
|
||||
<fixed facet="jst.utility"/>
|
||||
<installed facet="jst.utility" version="1.0"/>
|
||||
<installed facet="java" version="1.8"/>
|
||||
</faceted-project>
|
||||
@ -1,2 +0,0 @@
|
||||
boot.validation.initialized=true
|
||||
eclipse.preferences.version=1
|
||||
@ -1,3 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Class-Path:
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
|
||||
description = "maxkey-protocol-ltpa"
|
||||
|
||||
|
||||
dependencies {
|
||||
//local jars
|
||||
compile fileTree(dir: '../maxkey-lib/*/', include: '*.jar')
|
||||
|
||||
compile project(":maxkey-core")
|
||||
compile project(":maxkey-dao")
|
||||
compile project(":maxkey-jose-jwt")
|
||||
compile project(":maxkey-client-sdk")
|
||||
compile project(":maxkey-protocols:maxkey-protocol-authorize")
|
||||
|
||||
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Class-Path:
|
||||
|
||||
@ -1,105 +0,0 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.maxkey.authz.ltpa.endpoint;
|
||||
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.maxkey.authz.endpoint.AuthorizeBaseEndpoint;
|
||||
import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
|
||||
import org.maxkey.authz.ltpa.endpoint.adapter.LtpaDefaultAdapter;
|
||||
import org.maxkey.config.ApplicationConfig;
|
||||
import org.maxkey.constants.BOOLEAN;
|
||||
import org.maxkey.dao.service.AppsTokenBasedDetailsService;
|
||||
import org.maxkey.domain.apps.Apps;
|
||||
import org.maxkey.domain.apps.AppsTokenBasedDetails;
|
||||
import org.maxkey.util.Instance;
|
||||
import org.maxkey.web.WebContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* @author Crystal.Sea
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class LtpaAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(LtpaAuthorizeEndpoint.class);
|
||||
@Autowired
|
||||
AppsTokenBasedDetailsService tokenBasedDetailsService;
|
||||
|
||||
@Autowired
|
||||
ApplicationConfig applicationConfig;
|
||||
|
||||
LtpaDefaultAdapter defaultLtpaAdapter=new LtpaDefaultAdapter();
|
||||
|
||||
@RequestMapping("/authz/ltpa/{id}")
|
||||
public ModelAndView authorize(
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
@PathVariable("id") String id){
|
||||
|
||||
|
||||
AppsTokenBasedDetails ltpaDetails=tokenBasedDetailsService.get(id);
|
||||
_logger.debug(""+ltpaDetails);
|
||||
String cookieValue="";
|
||||
Apps application= getApp(id);
|
||||
ltpaDetails.setAdapter(application.getAdapter());
|
||||
ltpaDetails.setIsAdapter(application.getIsAdapter());
|
||||
|
||||
AbstractAuthorizeAdapter adapter;
|
||||
|
||||
if(BOOLEAN.isTrue(ltpaDetails.getIsAdapter())){
|
||||
adapter =(AbstractAuthorizeAdapter)Instance.newInstance(ltpaDetails.getAdapter());
|
||||
}else{
|
||||
adapter =(AbstractAuthorizeAdapter)defaultLtpaAdapter;
|
||||
}
|
||||
|
||||
String tokenData=adapter.generateInfo(
|
||||
WebContext.getUserInfo(),
|
||||
ltpaDetails);
|
||||
|
||||
String encryptTokenData=adapter.encrypt(
|
||||
tokenData,
|
||||
ltpaDetails.getAlgorithmKey(),
|
||||
ltpaDetails.getAlgorithm());
|
||||
|
||||
String signTokenData=adapter.sign(
|
||||
encryptTokenData,
|
||||
ltpaDetails);
|
||||
|
||||
cookieValue=signTokenData;
|
||||
|
||||
_logger.debug("Cookie Name : "+ltpaDetails.getCookieName());
|
||||
|
||||
Cookie cookie= new Cookie(ltpaDetails.getCookieName(),cookieValue);
|
||||
|
||||
Integer maxAge=Integer.parseInt(ltpaDetails.getExpires())*60;
|
||||
_logger.debug("Cookie Max Age :"+maxAge+" seconds.");
|
||||
cookie.setMaxAge(maxAge);
|
||||
|
||||
cookie.setPath("/");
|
||||
//
|
||||
//cookie.setDomain("."+applicationConfig.getSubDomainName());
|
||||
//tomcat 8.5
|
||||
cookie.setDomain(applicationConfig.getSubDomainName());
|
||||
|
||||
_logger.debug("Sub Domain Name : "+"."+applicationConfig.getSubDomainName());
|
||||
response.addCookie(cookie);
|
||||
|
||||
if(ltpaDetails.getRedirectUri().indexOf(applicationConfig.getSubDomainName())>-1){
|
||||
return WebContext.redirect(ltpaDetails.getRedirectUri());
|
||||
}else{
|
||||
_logger.error(ltpaDetails.getRedirectUri()+" not in domain "+applicationConfig.getSubDomainName());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,83 +0,0 @@
|
||||
package org.maxkey.authz.ltpa.endpoint.adapter;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
|
||||
import org.maxkey.constants.BOOLEAN;
|
||||
import org.maxkey.domain.UserInfo;
|
||||
import org.maxkey.domain.apps.AppsTokenBasedDetails;
|
||||
import org.maxkey.util.DateUtils;
|
||||
import org.maxkey.util.JsonUtils;
|
||||
import org.maxkey.util.StringGenerator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
public class LtpaDefaultAdapter extends AbstractAuthorizeAdapter {
|
||||
final static Logger _logger = LoggerFactory.getLogger(LtpaDefaultAdapter.class);
|
||||
@Override
|
||||
public String generateInfo(UserInfo userInfo,Object app) {
|
||||
AppsTokenBasedDetails details=(AppsTokenBasedDetails)app;
|
||||
HashMap<String,String> beanMap=new HashMap<String,String>();
|
||||
|
||||
beanMap.put("randomId",(new StringGenerator()).uuidGenerate());
|
||||
|
||||
if(BOOLEAN.isTrue(details.getUid())){
|
||||
beanMap.put("uid",userInfo.getId());
|
||||
}
|
||||
if(BOOLEAN.isTrue(details.getUsername())){
|
||||
beanMap.put("username", userInfo.getUsername());
|
||||
}
|
||||
if(BOOLEAN.isTrue(details.getEmail())){
|
||||
beanMap.put("email", userInfo.getEmail());
|
||||
}
|
||||
if(BOOLEAN.isTrue(details.getWindowsAccount())){
|
||||
beanMap.put("windowsAccount", userInfo.getWindowsAccount());
|
||||
}
|
||||
if(BOOLEAN.isTrue(details.getEmployeeNumber())){
|
||||
beanMap.put("employeeNumber", userInfo.getEmployeeNumber());
|
||||
}
|
||||
if(BOOLEAN.isTrue(details.getDepartmentId())){
|
||||
beanMap.put("departmentId", userInfo.getDepartmentId());
|
||||
}
|
||||
if(BOOLEAN.isTrue(details.getDepartment())){
|
||||
beanMap.put("department", userInfo.getDepartment());
|
||||
}
|
||||
|
||||
beanMap.put("displayName", userInfo.getDisplayName());
|
||||
|
||||
/*
|
||||
* use UTC date time format
|
||||
* current date plus expires minute
|
||||
*/
|
||||
Integer expiresLong=Integer.parseInt(details.getExpires());
|
||||
Date currentDate=new Date();
|
||||
Date expiresDate=DateUtils.addMinutes(currentDate,expiresLong);
|
||||
String expiresString=DateUtils.toUtc(expiresDate);
|
||||
_logger.debug("UTC Local current date : "+DateUtils.toUtcLocal(currentDate));
|
||||
_logger.debug("UTC current Date : "+DateUtils.toUtc(currentDate));
|
||||
_logger.debug("UTC expires Date : "+DateUtils.toUtc(expiresDate));
|
||||
|
||||
beanMap.put("at", DateUtils.toUtc(currentDate));
|
||||
|
||||
beanMap.put("expires", expiresString);
|
||||
|
||||
String jsonString=JsonUtils.object2Json(beanMap);
|
||||
_logger.debug("Token : "+jsonString);
|
||||
|
||||
return jsonString;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String encrypt(String data, String algorithmKey, String algorithm) {
|
||||
return super.encrypt(data, algorithmKey, algorithm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView authorize(UserInfo userInfo, Object app, String data,ModelAndView modelAndView) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -5,6 +5,7 @@ import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.maxkey.authn.BasicAuthentication;
|
||||
import org.maxkey.authz.oauth2.common.util.OAuth2Utils;
|
||||
import org.maxkey.authz.oauth2.provider.AuthorizationRequest;
|
||||
import org.maxkey.authz.oauth2.provider.ClientDetailsService;
|
||||
@ -51,8 +52,7 @@ public class OAuth20AccessConfirmationController {
|
||||
for(Object key:model.keySet()){
|
||||
modelRequest.put(key.toString(), model.get(key).toString());
|
||||
}
|
||||
Principal principal=(Principal)WebContext.getAuthentication().getPrincipal();
|
||||
|
||||
String principal=((BasicAuthentication)WebContext.getAuthentication().getPrincipal()).getJ_username();
|
||||
//Map<String, Object> model
|
||||
AuthorizationRequest clientAuth = (AuthorizationRequest) WebContext.getAttribute("authorizationRequest");
|
||||
ClientDetails client = clientDetailsService.loadClientByClientId(clientAuth.getClientId());
|
||||
@ -63,7 +63,8 @@ public class OAuth20AccessConfirmationController {
|
||||
for (String scope : clientAuth.getScope()) {
|
||||
scopes.put(OAuth2Utils.SCOPE_PREFIX + scope, "false");
|
||||
}
|
||||
for (Approval approval : approvalStore.getApprovals(principal.getName(), client.getClientId())) {
|
||||
|
||||
for (Approval approval : approvalStore.getApprovals(principal, client.getClientId())) {
|
||||
if (clientAuth.getScope().contains(approval.getScope())) {
|
||||
scopes.put(OAuth2Utils.SCOPE_PREFIX + approval.getScope(),
|
||||
approval.getStatus() == ApprovalStatus.APPROVED ? "true" : "false");
|
||||
|
||||
@ -27,6 +27,7 @@ import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.annotation.WebFilter;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@ -73,6 +74,7 @@ import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
@WebFilter(filterName = "TokenEndpointAuthenticationFilter", urlPatterns = "/oauth/v20/token/*")
|
||||
public class TokenEndpointAuthenticationFilter implements Filter {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(TokenEndpointAuthenticationFilter.class);
|
||||
|
||||
@ -64,8 +64,8 @@ public class UserInfoEndpoint {
|
||||
private UserInfoService userInfoService;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("applicationsService")
|
||||
protected AppsService applicationsService;
|
||||
@Qualifier("appsService")
|
||||
protected AppsService appsService;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("jwtSignerValidationService")
|
||||
@ -100,7 +100,7 @@ public class UserInfoEndpoint {
|
||||
|
||||
String client_id= oAuth2Authentication.getOAuth2Request().getClientId();
|
||||
UserInfo userInfo=queryUserInfo(principal);
|
||||
Apps app=applicationsService.get(client_id);
|
||||
Apps app=appsService.get(client_id);
|
||||
|
||||
String userJson="";
|
||||
|
||||
@ -281,9 +281,7 @@ public class UserInfoEndpoint {
|
||||
|
||||
public UserInfo queryUserInfo(String uid){
|
||||
_logger.debug("uid : "+uid);
|
||||
UserInfo queryUserInfo=new UserInfo();
|
||||
queryUserInfo.setUsername(uid);
|
||||
UserInfo userInfo = (UserInfo) userInfoService.load(queryUserInfo);
|
||||
UserInfo userInfo = (UserInfo) userInfoService.loadByUsername(uid);
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ public class IdpInitEndpoint {
|
||||
HttpServletResponse response,
|
||||
@PathVariable("appid") String appId)throws Exception {
|
||||
logger.debug("SAML IDP init , app id is "+appId);
|
||||
AppsSAML20Details saml20Details = saml20DetailsService.get(appId);
|
||||
AppsSAML20Details saml20Details = saml20DetailsService.getAppDetails(appId);
|
||||
|
||||
if (saml20Details == null) {
|
||||
logger.error("samlId[" + appId + "] Error .");
|
||||
|
||||
@ -89,7 +89,7 @@ public class SingleSignOnEndpoint {
|
||||
}
|
||||
|
||||
public void extractSaml20Detail(ExtractBindingAdapter extractBindingAdapter,String samlId) throws Exception{
|
||||
AppsSAML20Details saml20Details = saml20DetailsService.get(samlId);
|
||||
AppsSAML20Details saml20Details = saml20DetailsService.getAppDetails(samlId);
|
||||
|
||||
if (saml20Details == null) {
|
||||
logger.error("Request SAML APPID [" + samlId + "] is not exist .");
|
||||
|
||||
1
maxkey-protocols/maxkey-protocol-tokenbased/bin/main/.gitignore
vendored
Normal file
1
maxkey-protocols/maxkey-protocol-tokenbased/bin/main/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/org/
|
||||
@ -3,6 +3,7 @@
|
||||
*/
|
||||
package org.maxkey.authz.token.endpoint;
|
||||
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@ -76,13 +77,43 @@ public class TokenBasedAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
encryptTokenData,
|
||||
tokenBasedDetails);
|
||||
|
||||
modelAndView=adapter.authorize(
|
||||
WebContext.getUserInfo(),
|
||||
tokenBasedDetails,
|
||||
signTokenData,
|
||||
modelAndView);
|
||||
if(tokenBasedDetails.getTokenType().equalsIgnoreCase("POST")) {
|
||||
modelAndView=adapter.authorize(
|
||||
WebContext.getUserInfo(),
|
||||
tokenBasedDetails,
|
||||
signTokenData,
|
||||
modelAndView);
|
||||
|
||||
return modelAndView;
|
||||
return modelAndView;
|
||||
}else {
|
||||
|
||||
String cookieValue="";
|
||||
cookieValue=signTokenData;
|
||||
|
||||
_logger.debug("Cookie Name : "+tokenBasedDetails.getCookieName());
|
||||
|
||||
Cookie cookie= new Cookie(tokenBasedDetails.getCookieName(),cookieValue);
|
||||
|
||||
Integer maxAge=Integer.parseInt(tokenBasedDetails.getExpires())*60;
|
||||
_logger.debug("Cookie Max Age :"+maxAge+" seconds.");
|
||||
cookie.setMaxAge(maxAge);
|
||||
|
||||
cookie.setPath("/");
|
||||
//
|
||||
//cookie.setDomain("."+applicationConfig.getSubDomainName());
|
||||
//tomcat 8.5
|
||||
cookie.setDomain(applicationConfig.getSubDomainName());
|
||||
|
||||
_logger.debug("Sub Domain Name : "+"."+applicationConfig.getSubDomainName());
|
||||
response.addCookie(cookie);
|
||||
|
||||
if(tokenBasedDetails.getRedirectUri().indexOf(applicationConfig.getSubDomainName())>-1){
|
||||
return WebContext.redirect(tokenBasedDetails.getRedirectUri());
|
||||
}else{
|
||||
_logger.error(tokenBasedDetails.getRedirectUri()+" not in domain "+applicationConfig.getSubDomainName());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ public class DesktopDetailsController extends BaseAppContorller {
|
||||
|
||||
transform(desktopDetails);
|
||||
desktopDetailsService.insert(desktopDetails);
|
||||
if (appsService.insert(desktopDetails)) {
|
||||
if (appsService.insertApp(desktopDetails)) {
|
||||
new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
@ -81,7 +81,7 @@ public class DesktopDetailsController extends BaseAppContorller {
|
||||
_logger.debug("-update application :" + desktopDetails);
|
||||
transform(desktopDetails);
|
||||
|
||||
if (desktopDetailsService.update(desktopDetails)&&appsService.update(desktopDetails)) {
|
||||
if (desktopDetailsService.update(desktopDetails)&&appsService.updateApp(desktopDetails)) {
|
||||
new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
|
||||
@ -50,7 +50,7 @@ public class FormBasedDetailsController extends BaseAppContorller {
|
||||
|
||||
transform(formBasedDetails);
|
||||
|
||||
if (formBasedDetailsService.insert(formBasedDetails)&&appsService.insert(formBasedDetails)) {
|
||||
if (formBasedDetailsService.insert(formBasedDetails)&&appsService.insertApp(formBasedDetails)) {
|
||||
new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
@ -80,7 +80,7 @@ public class FormBasedDetailsController extends BaseAppContorller {
|
||||
//
|
||||
_logger.debug("-update application :" + formBasedDetails);
|
||||
transform(formBasedDetails);
|
||||
if (formBasedDetailsService.update(formBasedDetails)&&appsService.update(formBasedDetails)) {
|
||||
if (formBasedDetailsService.update(formBasedDetails)&&appsService.updateApp(formBasedDetails)) {
|
||||
new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
|
||||
@ -68,7 +68,7 @@ public class SAML20DetailsController extends BaseAppContorller {
|
||||
e.printStackTrace();
|
||||
}
|
||||
saml20DetailsService.insert(saml20Details);
|
||||
if (appsService.insert(saml20Details)) {
|
||||
if (appsService.insertApp(saml20Details)) {
|
||||
new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
@ -102,7 +102,7 @@ public class SAML20DetailsController extends BaseAppContorller {
|
||||
e.printStackTrace();
|
||||
}
|
||||
saml20DetailsService.update(saml20Details);
|
||||
if (appsService.update(saml20Details)) {
|
||||
if (appsService.updateApp(saml20Details)) {
|
||||
new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
|
||||
@ -50,7 +50,7 @@ public class TokenBasedDetailsController extends BaseAppContorller {
|
||||
|
||||
tokenBasedDetails.setAlgorithmKey(tokenBasedDetails.getSecret());
|
||||
|
||||
if (tokenBasedDetailsService.insert(tokenBasedDetails)&&appsService.insert(tokenBasedDetails)) {
|
||||
if (tokenBasedDetailsService.insert(tokenBasedDetails)&&appsService.insertApp(tokenBasedDetails)) {
|
||||
new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
@ -82,7 +82,7 @@ public class TokenBasedDetailsController extends BaseAppContorller {
|
||||
_logger.debug("-update application :" + tokenBasedDetails);
|
||||
transform(tokenBasedDetails);
|
||||
tokenBasedDetails.setAlgorithmKey(tokenBasedDetails.getSecret());
|
||||
if (tokenBasedDetailsService.update(tokenBasedDetails)&&appsService.update(tokenBasedDetails)) {
|
||||
if (tokenBasedDetailsService.update(tokenBasedDetails)&&appsService.updateApp(tokenBasedDetails)) {
|
||||
new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
|
||||
7
maxkey-web-manage/src/main/resources/static/js/Chart.min.js
vendored
Normal file
7
maxkey-web-manage/src/main/resources/static/js/Chart.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -40,6 +40,7 @@
|
||||
<link href="<@base />/static/jquery/metisMenu-v3.0.4/css/mm-vertical.css" rel="stylesheet" >
|
||||
<link href="<@base />/static/jquery/metisMenu-v3.0.4/metisMenu.min.css" rel="stylesheet" >
|
||||
<script src ="<@base />/static/jquery/metisMenu-v3.0.4/metisMenu.min.js" type="text/javascript" ></script>
|
||||
<script src ="<@base />/static/js/Chart.min.js" type="text/javascript" ></script>
|
||||
<#-- common script start -->
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
@ -3,7 +3,13 @@
|
||||
<head>
|
||||
<#include "layout/header.ftl"/>
|
||||
<#include "layout/common.cssjs.ftl"/>
|
||||
|
||||
<style>
|
||||
canvas {
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="app header-default side-nav-dark">
|
||||
@ -44,7 +50,7 @@
|
||||
</div>
|
||||
<div class="info-box-content">
|
||||
<h4 class="number">1125</h4>
|
||||
<p class="info-text">All Properties</p>
|
||||
<p class="info-text">用户在线</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -55,7 +61,7 @@
|
||||
</div>
|
||||
<div class="info-box-content">
|
||||
<h4 class="number">351</h4>
|
||||
<p class="info-text">For Sale</p>
|
||||
<p class="info-text">当天访问量</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -66,7 +72,7 @@
|
||||
</div>
|
||||
<div class="info-box-content">
|
||||
<h4 class="number">774</h4>
|
||||
<p class="info-text">For Rent</p>
|
||||
<p class="info-text">当月新用户</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -76,8 +82,8 @@
|
||||
<i class="lni-wallet"></i>
|
||||
</div>
|
||||
<div class="info-box-content">
|
||||
<h4 class="number">$49450</h4>
|
||||
<p class="info-text">Total Revenue</p>
|
||||
<h4 class="number">49450</h4>
|
||||
<p class="info-text">本月活跃用户</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -86,295 +92,104 @@
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">Business Overview</h5>
|
||||
<h5 class="card-title">本月访问情况</h5>
|
||||
<div class="float-right">
|
||||
<ul class="list-inline d-none d-sm-block">
|
||||
<li>
|
||||
<span class="status bg-primary"></span>
|
||||
<span class="text-semibold">Sales</span>
|
||||
<span class="text-semibold"></span>
|
||||
</li>
|
||||
<li>
|
||||
<span class="status bg-success"></span>
|
||||
<span class="text-semibold">Expense</span>
|
||||
<span class="text-semibold"></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="morris-line-example" style="height: 300px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-12 col-xs-12">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-12 col-xs-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Sales Details of Properties</h5>
|
||||
<div class="row">
|
||||
<div class="col-5 m-t-20">
|
||||
<h3 class="text-primary">$7492</h3>
|
||||
<p class="text-muted">July 2018</p>
|
||||
<b>(149 Sales)</b>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<div id="sales1" class="text-right">
|
||||
<div id="morris-bar-example" style="height: 130px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-12 col-xs-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Rent Details of Properties</h5>
|
||||
<div class="row">
|
||||
<div class="col-5 m-t-20">
|
||||
<h3 class="text-info">$1930</h3>
|
||||
<p class="light_op_text">July 2018</p>
|
||||
<b class="">(170 Rentals)</b>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<div id="morris-bar-stacked" style="height: 130px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="properties">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title">Recent properties</h4>
|
||||
<div class="card-toolbar">
|
||||
<ul>
|
||||
<li>
|
||||
<a class="text-gray" href="#">
|
||||
<i class="lni-more-alt"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-media">
|
||||
<li class="list-item">
|
||||
<div class="client-item">
|
||||
<div class="media-img">
|
||||
<img src="assets/img/properties/img1.jpg" alt="">
|
||||
</div>
|
||||
<div class="info">
|
||||
<h4 class="title text-semibold"><a href="#">795 Folsom Ave, Suite 600 San Francisco</a></h4>
|
||||
<p class="m-0">20 July 2018, John Doe</p>
|
||||
<div class="float-item">
|
||||
<button class="btn btn-success">Rent</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-item">
|
||||
<div class="client-item">
|
||||
<div class="media-img">
|
||||
<img src="assets/img/properties/img2.jpg" alt="">
|
||||
</div>
|
||||
<div class="info">
|
||||
<h4 class="title text-semibold"><a href="#">795 Folsom Ave, Suite 600 San Francisco</a></h4>
|
||||
<p class="m-0">17 July 2018, Venessa Fern</p>
|
||||
<div class="float-item">
|
||||
<button class="btn btn-common">Sale</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-item">
|
||||
<div class="client-item">
|
||||
<div class="media-img">
|
||||
<img src="assets/img/properties/img3.jpg" alt="">
|
||||
</div>
|
||||
<div class="info">
|
||||
<h4 class="title text-semibold"><a href="#">795 Folsom Ave, Suite 600 San Francisco</a></h4>
|
||||
<p class="m-0">13 July 2018, Danielle M. Stong</p>
|
||||
<div class="float-item">
|
||||
<button class="btn btn-success">Rent</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-item">
|
||||
<div class="client-item">
|
||||
<div class="media-img">
|
||||
<img src="assets/img/properties/img4.jpg" alt="">
|
||||
</div>
|
||||
<div class="info">
|
||||
<h4 class="title text-semibold"><a href="#">795 Folsom Ave, Suite 600 San Francisco</a></h4>
|
||||
<p class="m-0">09 July 2018, Ample</p>
|
||||
<div class="float-item">
|
||||
<button class="btn btn-common">Sale</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-4 col-xs-12">
|
||||
<div class="card">
|
||||
<div class="profile-bg">
|
||||
<div class="user-profile">
|
||||
<figure class="profile-wall-img">
|
||||
<img class="img-fluid" src="assets/img/profile/user-bg.jpg" alt="User Wall">
|
||||
</figure>
|
||||
<div class="profile-body">
|
||||
<figure class="profile-user-avatar">
|
||||
<img src="assets/img/profile/user1.jpg" alt="User Wall">
|
||||
</figure>
|
||||
<h3 class="profile-user-name m-0">Michael A. Franklin</h3>
|
||||
<small class="profile-user-address">California, United States</small>
|
||||
</div>
|
||||
<form class="forms-profile">
|
||||
<h4 class="text-center">
|
||||
Request Inquiry
|
||||
</h4>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-12">
|
||||
<input type="text" class="form-control" id="exampleInputUsername2" placeholder="Full Name*">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-12">
|
||||
<input type="email" class="form-control" id="exampleInputEmail2" placeholder="Email ID*">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-12">
|
||||
<input type="text" class="form-control" id="exampleInputMobile" placeholder="Mobile number*">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="exampleTextarea1" rows="3"></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-common">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-xs-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title">Property Overview</h4>
|
||||
</div>
|
||||
<div class="table-overflow">
|
||||
<table class="table table-hover table-lg">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-dark text-semibold">Order No.</td>
|
||||
<td class="text-dark text-semibold">Customer</td>
|
||||
<td class="text-dark text-semibold">Property</td>
|
||||
<td class="text-dark text-semibold">Date</td>
|
||||
<td class="text-dark text-semibold">Status</td>
|
||||
<td class="text-dark text-semibold">Action</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="invoice.html">#ODN84952</a>
|
||||
</td>
|
||||
<td>John Doe</td>
|
||||
<td>795 Folsom Ave, Suite 600 San Francisco</td>
|
||||
<td>25/07/2018</td>
|
||||
<td><a href="#" class="badge badge-success">Paid</a></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="lni-more-alt"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="#"><i class="lni-pencil mr-2 text-muted"></i>Edit Contact</a>
|
||||
<a class="dropdown-item" href="#"><i class="lni-trash mr-2 text-muted"></i>Remove</a>
|
||||
<a class="dropdown-item" href="#"><i class="lni-envelope mr-2 text-muted"></i>Send Email</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="invoice.html">#ODN84952</a>
|
||||
</td>
|
||||
<td>Venessa Fern</td>
|
||||
<td>795 Folsom Ave, Suite 600 San Francisco</td>
|
||||
<td>19/07/2018</td>
|
||||
<td><a href="#" class="badge badge-info">Pending</a></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="lni-more-alt"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="#"><i class="lni-pencil mr-2 text-muted"></i>Edit Contact</a>
|
||||
<a class="dropdown-item" href="#"><i class="lni-trash mr-2 text-muted"></i>Remove</a>
|
||||
<a class="dropdown-item" href="#"><i class="lni-envelope mr-2 text-muted"></i>Send Email</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="invoice.html">#ODN84952</a>
|
||||
</td>
|
||||
<td>John Doe</td>
|
||||
<td>795 Folsom Ave, Suite 600 San Francisco</td>
|
||||
<td>15/07/2018</td>
|
||||
<td><a href="#" class="badge badge-danger">Fuiled</a></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="lni-more-alt"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="#"><i class="lni-pencil mr-2 text-muted"></i>Edit Contact</a>
|
||||
<a class="dropdown-item" href="#"><i class="lni-trash mr-2 text-muted"></i>Remove</a>
|
||||
<a class="dropdown-item" href="#"><i class="lni-envelope mr-2 text-muted"></i>Send Email</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="invoice.html">#ODN84952</a>
|
||||
</td>
|
||||
<td>Ample</td>
|
||||
<td>795 Folsom Ave, Suite 600 San Francisco</td>
|
||||
<td>04/07/2018</td>
|
||||
<td><a href="#" class="badge badge-success">Paid</a></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="lni-more-alt"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="#"><i class="lni-pencil mr-2 text-muted"></i>Edit Contact</a>
|
||||
<a class="dropdown-item" href="#"><i class="lni-trash mr-2 text-muted"></i>Remove</a>
|
||||
<a class="dropdown-item" href="#"><i class="lni-envelope mr-2 text-muted"></i>Send Email</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="morris-line-example" >
|
||||
<canvas id="canvas" style="height: 400px;width:98%;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var randomScalingFactor = function() {
|
||||
return Math.ceil(Math.random() * 10.0) * Math.pow(10, Math.ceil(Math.random() * 5));
|
||||
};
|
||||
|
||||
var config = {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ['1', '2', '3', '4', '5', '6', '7','8','9','10',
|
||||
'11','12','13','14','15','16','17','18','19','20',
|
||||
'21','22','23','24','25','26','27','28','29','30','31'],
|
||||
datasets: [{
|
||||
label:"访问量",
|
||||
backgroundColor: 'rgb(75, 192, 192)',
|
||||
borderColor: 'rgb(75, 192, 192)',
|
||||
fill: false,
|
||||
data: [
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor(),
|
||||
randomScalingFactor()
|
||||
],
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
title: {
|
||||
display: true
|
||||
//,text: '访问情况'
|
||||
},
|
||||
scales: {
|
||||
xAxes: [{
|
||||
display: true,
|
||||
}],
|
||||
yAxes: [{
|
||||
display: true,
|
||||
type: 'logarithmic',
|
||||
}]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
window.onload = function() {
|
||||
var ctx = document.getElementById('canvas').getContext('2d');
|
||||
window.myLine = new Chart(ctx, config);
|
||||
};
|
||||
|
||||
</script>
|
||||
<footer class="content-footer">
|
||||
<#include "layout/footer.ftl"/>
|
||||
</footer>
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
<comment>maxkey-web-maxkey</comment>
|
||||
<projects>
|
||||
<project>maxkey-protocol-desktop</project>
|
||||
<project>maxkey-protocol-ltpa</project>
|
||||
<project>maxkey-protocol-tokenbased</project>
|
||||
<project>maxkey-client-sdk</project>
|
||||
<project>maxkey-jose-jwt</project>
|
||||
|
||||
@ -8,9 +8,20 @@ org.eclipse.jdt.core.circularClasspath=warning
|
||||
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
|
||||
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
|
||||
org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
|
||||
org.eclipse.jdt.core.incompleteClasspath=error
|
||||
|
||||
@ -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>
|
||||
|
||||
911
sql/maxkey_v1.0.sql
Normal file
911
sql/maxkey_v1.0.sql
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user