├── .settings ├── org.eclipse.wst.jsdt.ui.superType.name ├── org.eclipse.wst.jsdt.ui.superType.container ├── org.eclipse.wst.validation.prefs ├── org.eclipse.m2e.core.prefs ├── org.eclipse.wst.common.project.facet.core.xml ├── .jsdtscope ├── org.eclipse.wst.common.component └── org.eclipse.jdt.core.prefs ├── src └── main │ ├── webapp │ ├── AmazeUI-2.1.0 │ │ ├── assets │ │ │ ├── css │ │ │ │ ├── app.css │ │ │ │ └── admin.css │ │ │ ├── i │ │ │ │ ├── favicon.png │ │ │ │ ├── app-icon72x72@2x.png │ │ │ │ ├── examples │ │ │ │ │ ├── admin-ie.png │ │ │ │ │ ├── blogPage.png │ │ │ │ │ ├── landing.png │ │ │ │ │ ├── adminPage.png │ │ │ │ │ ├── loginPage.png │ │ │ │ │ ├── admin-chrome.png │ │ │ │ │ ├── admin-firefox.png │ │ │ │ │ ├── admin-opera.png │ │ │ │ │ ├── admin-safari.png │ │ │ │ │ ├── landingPage.png │ │ │ │ │ └── sidebarPage.png │ │ │ │ └── startup-640x1096.png │ │ │ ├── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ └── fontawesome-webfont.woff │ │ │ └── js │ │ │ │ ├── app.js │ │ │ │ └── polyfill │ │ │ │ ├── rem.min.js │ │ │ │ └── respond.min.js │ │ ├── login.html │ │ ├── admin-404.html │ │ ├── admin-help.html │ │ └── iscroll.html │ ├── assets │ │ ├── images │ │ │ ├── rss.png │ │ │ ├── ad125.jpg │ │ │ ├── navbg.png │ │ │ ├── 1-thumb.jpg │ │ │ ├── 2-thumb.jpg │ │ │ ├── 3-thumb.jpg │ │ │ ├── 4-thumb.jpg │ │ │ ├── 5-thumb.jpg │ │ │ ├── 6-thumb.jpg │ │ │ ├── 7-thumb.jpg │ │ │ ├── bodybkg.gif │ │ │ ├── introbkg.png │ │ │ ├── cappuccino.jpg │ │ │ ├── introimage.png │ │ │ ├── oauth-2-sm.png │ │ │ ├── oauth2-process.png │ │ │ └── examples │ │ │ │ ├── OAuth_home.png │ │ │ │ ├── OAuth_login.png │ │ │ │ ├── OAuth_Success.png │ │ │ │ ├── OAuth_ApplySite.png │ │ │ │ ├── OAuth_ApproveSite.png │ │ │ │ └── OAuth_Authorization.png │ │ ├── js │ │ │ └── equalcolumns.js │ │ └── css │ │ │ ├── oauth_error.css │ │ │ └── home_client.css │ └── WEB-INF │ │ ├── lib │ │ └── ojdbc8.jar │ │ ├── views │ │ ├── common │ │ │ ├── commonInclude.jsp │ │ │ ├── footer.jsp │ │ │ ├── header.jsp │ │ │ └── commonMenu.jsp │ │ ├── login │ │ │ └── login.jsp │ │ ├── client │ │ │ ├── auth_user.jsp │ │ │ └── home_client.jsp │ │ ├── oauth2 │ │ │ ├── oauth2_authorize_fail.jsp │ │ │ ├── oauth2_login_app.jsp │ │ │ └── oauth2_login.jsp │ │ ├── api │ │ │ └── resource_list.jsp │ │ ├── index.jsp │ │ ├── welcome │ │ │ └── welcome.jsp │ │ └── site │ │ │ ├── site_apply.jsp │ │ │ ├── site_approval.jsp │ │ │ └── site_authorize.jsp │ │ └── web.xml │ ├── java │ └── com │ │ └── favccxx │ │ └── favauth │ │ ├── dao │ │ ├── IAuthUserDao.java │ │ ├── IAuthAppDao.java │ │ ├── IAuthClientDao.java │ │ ├── impl │ │ │ ├── AuthUserDaoImpl.java │ │ │ ├── AuthAppDaoImpl.java │ │ │ ├── AuthClientDaoImpl.java │ │ │ └── BaseDaoImpl.java │ │ └── IBaseDao.java │ │ ├── constants │ │ └── OAuth2Constants.java │ │ ├── controller │ │ ├── IndexController.java │ │ ├── api │ │ │ └── ApiResourceController.java │ │ ├── welcome │ │ │ └── WelcomeController.java │ │ ├── login │ │ │ └── OAuth2LoginController.java │ │ ├── client │ │ │ ├── AuthResourceClientController.java │ │ │ └── AuthCodeClientController.java │ │ ├── site │ │ │ └── AppSiteController.java │ │ └── server │ │ │ ├── AuthUserController.java │ │ │ ├── AccessTokenController.java │ │ │ └── AuthorizationController.java │ │ ├── service │ │ ├── IAuthUserService.java │ │ ├── IAuthAppService.java │ │ ├── IAuthClientService.java │ │ ├── impl │ │ │ ├── AuthUserServiceImpl.java │ │ │ ├── AuthClientServiceImpl.java │ │ │ ├── AuthVerifyServiceImpl.java │ │ │ └── AuthAppServiceImpl.java │ │ ├── IFavAuthService.java │ │ └── IAuthVerifyService.java │ │ ├── model │ │ ├── AuthClient.java │ │ ├── AuthApp.java │ │ └── AuthUser.java │ │ └── util │ │ └── HttpClientUtils.java │ └── resources │ ├── ehcache │ └── ehcache.xml │ ├── log4j2.xml │ ├── spring │ ├── spring-config-cache.xml │ └── spring-config.xml │ ├── database.properties │ └── springmvc │ └── spring-mvc.xml ├── target ├── classes │ ├── com │ │ └── favccxx │ │ │ └── favauth │ │ │ ├── dao │ │ │ ├── IBaseDao.class │ │ │ ├── IAuthAppDao.class │ │ │ ├── IAuthUserDao.class │ │ │ ├── IAuthClientDao.class │ │ │ └── impl │ │ │ │ ├── BaseDaoImpl.class │ │ │ │ ├── AuthAppDaoImpl.class │ │ │ │ ├── AuthUserDaoImpl.class │ │ │ │ └── AuthClientDaoImpl.class │ │ │ ├── model │ │ │ ├── AuthApp.class │ │ │ ├── AuthUser.class │ │ │ └── AuthClient.class │ │ │ ├── util │ │ │ └── HttpClientUtils.class │ │ │ ├── service │ │ │ ├── IAuthAppService.class │ │ │ ├── IAuthUserService.class │ │ │ ├── IFavAuthService.class │ │ │ ├── IAuthClientService.class │ │ │ ├── IAuthVerifyService.class │ │ │ └── impl │ │ │ │ ├── AuthAppServiceImpl.class │ │ │ │ ├── AuthClientServiceImpl.class │ │ │ │ ├── AuthUserServiceImpl.class │ │ │ │ └── AuthVerifyServiceImpl.class │ │ │ ├── constants │ │ │ └── OAuth2Constants.class │ │ │ └── controller │ │ │ ├── IndexController.class │ │ │ ├── site │ │ │ └── AppSiteController.class │ │ │ ├── api │ │ │ └── ApiResourceController.class │ │ │ ├── server │ │ │ ├── AuthUserController.class │ │ │ ├── AccessTokenController.class │ │ │ └── AuthorizationController.class │ │ │ ├── welcome │ │ │ └── WelcomeController.class │ │ │ ├── login │ │ │ └── OAuth2LoginController.class │ │ │ └── client │ │ │ ├── AuthCodeClientController.class │ │ │ └── AuthResourceClientController.class │ ├── ehcache │ │ └── ehcache.xml │ ├── log4j2.xml │ ├── spring │ │ ├── spring-config-cache.xml │ │ └── spring-config.xml │ ├── database.properties │ └── springmvc │ │ └── spring-mvc.xml └── m2e-wtp │ └── web-resources │ └── META-INF │ ├── MANIFEST.MF │ └── maven │ └── com.favccxx.favauth │ └── FavOAuth2 │ ├── pom.properties │ └── pom.xml ├── .classpath └── .project /.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/css/app.css: -------------------------------------------------------------------------------- 1 | /* Write your styles */ -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | disabled=06target 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /src/main/webapp/assets/images/rss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/rss.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/ojdbc8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/WEB-INF/lib/ojdbc8.jar -------------------------------------------------------------------------------- /src/main/webapp/assets/images/ad125.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/ad125.jpg -------------------------------------------------------------------------------- /src/main/webapp/assets/images/navbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/navbg.png -------------------------------------------------------------------------------- /src/main/webapp/assets/images/1-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/1-thumb.jpg -------------------------------------------------------------------------------- /src/main/webapp/assets/images/2-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/2-thumb.jpg -------------------------------------------------------------------------------- /src/main/webapp/assets/images/3-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/3-thumb.jpg -------------------------------------------------------------------------------- /src/main/webapp/assets/images/4-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/4-thumb.jpg -------------------------------------------------------------------------------- /src/main/webapp/assets/images/5-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/5-thumb.jpg -------------------------------------------------------------------------------- /src/main/webapp/assets/images/6-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/6-thumb.jpg -------------------------------------------------------------------------------- /src/main/webapp/assets/images/7-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/7-thumb.jpg -------------------------------------------------------------------------------- /src/main/webapp/assets/images/bodybkg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/bodybkg.gif -------------------------------------------------------------------------------- /src/main/webapp/assets/images/introbkg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/introbkg.png -------------------------------------------------------------------------------- /.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /src/main/webapp/assets/images/cappuccino.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/cappuccino.jpg -------------------------------------------------------------------------------- /src/main/webapp/assets/images/introimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/introimage.png -------------------------------------------------------------------------------- /src/main/webapp/assets/images/oauth-2-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/oauth-2-sm.png -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/i/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/i/favicon.png -------------------------------------------------------------------------------- /src/main/webapp/assets/images/oauth2-process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/oauth2-process.png -------------------------------------------------------------------------------- /src/main/webapp/assets/images/examples/OAuth_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/examples/OAuth_home.png -------------------------------------------------------------------------------- /src/main/webapp/assets/images/examples/OAuth_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/examples/OAuth_login.png -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/dao/IBaseDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/dao/IBaseDao.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/model/AuthApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/model/AuthApp.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/model/AuthUser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/model/AuthUser.class -------------------------------------------------------------------------------- /src/main/webapp/assets/images/examples/OAuth_Success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/examples/OAuth_Success.png -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/dao/IAuthAppDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/dao/IAuthAppDao.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/dao/IAuthUserDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/dao/IAuthUserDao.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/model/AuthClient.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/model/AuthClient.class -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/i/app-icon72x72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/i/app-icon72x72@2x.png -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/i/examples/admin-ie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/i/examples/admin-ie.png -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/i/examples/blogPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/i/examples/blogPage.png -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/i/examples/landing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/i/examples/landing.png -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/i/startup-640x1096.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/i/startup-640x1096.png -------------------------------------------------------------------------------- /src/main/webapp/assets/images/examples/OAuth_ApplySite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/examples/OAuth_ApplySite.png -------------------------------------------------------------------------------- /src/main/webapp/assets/images/examples/OAuth_ApproveSite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/examples/OAuth_ApproveSite.png -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/dao/IAuthClientDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/dao/IAuthClientDao.class -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/i/examples/adminPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/i/examples/adminPage.png -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/i/examples/loginPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/i/examples/loginPage.png -------------------------------------------------------------------------------- /src/main/webapp/assets/images/examples/OAuth_Authorization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/assets/images/examples/OAuth_Authorization.png -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/dao/impl/BaseDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/dao/impl/BaseDaoImpl.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/util/HttpClientUtils.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/util/HttpClientUtils.class -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/i/examples/admin-chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/i/examples/admin-chrome.png -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/i/examples/admin-firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/i/examples/admin-firefox.png -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/i/examples/admin-opera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/i/examples/admin-opera.png -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/i/examples/admin-safari.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/i/examples/admin-safari.png -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/i/examples/landingPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/i/examples/landingPage.png -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/i/examples/sidebarPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/i/examples/sidebarPage.png -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/dao/impl/AuthAppDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/dao/impl/AuthAppDaoImpl.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/dao/impl/AuthUserDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/dao/impl/AuthUserDaoImpl.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/service/IAuthAppService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/service/IAuthAppService.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/service/IAuthUserService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/service/IAuthUserService.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/service/IFavAuthService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/service/IFavAuthService.class -------------------------------------------------------------------------------- /target/m2e-wtp/web-resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: Z003M7YH 3 | Build-Jdk: 1.8.0_161 4 | Created-By: Maven Integration for Eclipse 5 | 6 | -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/src/main/webapp/AmazeUI-2.1.0/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/constants/OAuth2Constants.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/constants/OAuth2Constants.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/controller/IndexController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/controller/IndexController.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/dao/impl/AuthClientDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/dao/impl/AuthClientDaoImpl.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/service/IAuthClientService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/service/IAuthClientService.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/service/IAuthVerifyService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/service/IAuthVerifyService.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/service/impl/AuthAppServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/service/impl/AuthAppServiceImpl.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/controller/site/AppSiteController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/controller/site/AppSiteController.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/service/impl/AuthClientServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/service/impl/AuthClientServiceImpl.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/service/impl/AuthUserServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/service/impl/AuthUserServiceImpl.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/service/impl/AuthVerifyServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/service/impl/AuthVerifyServiceImpl.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/controller/api/ApiResourceController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/controller/api/ApiResourceController.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/controller/server/AuthUserController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/controller/server/AuthUserController.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/controller/welcome/WelcomeController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/controller/welcome/WelcomeController.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/controller/login/OAuth2LoginController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/controller/login/OAuth2LoginController.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/controller/server/AccessTokenController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/controller/server/AccessTokenController.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/controller/server/AuthorizationController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/controller/server/AuthorizationController.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/controller/client/AuthCodeClientController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/controller/client/AuthCodeClientController.class -------------------------------------------------------------------------------- /target/classes/com/favccxx/favauth/controller/client/AuthResourceClientController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/favccxx/FavOAuth2/HEAD/target/classes/com/favccxx/favauth/controller/client/AuthResourceClientController.class -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /target/m2e-wtp/web-resources/META-INF/maven/com.favccxx.favauth/FavOAuth2/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Fri May 11 15:29:09 CST 2018 3 | version=0.0.1-SNAPSHOT 4 | groupId=com.favccxx.favauth 5 | m2e.projectName=FavOAuth2 6 | m2e.projectLocation=C\:\\Users\\Z003M7YH\\git\\FavOAuth2 7 | artifactId=FavOAuth2 8 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/dao/IAuthUserDao.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.dao; 2 | 3 | import com.favccxx.favauth.model.AuthUser; 4 | 5 | public interface IAuthUserDao extends IBaseDao { 6 | 7 | /** 8 | * 根据用户名查找用户信息 9 | * @param username 10 | * @return 11 | */ 12 | AuthUser findByUserName(String userName); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/constants/OAuth2Constants.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.constants; 2 | 3 | public interface OAuth2Constants { 4 | 5 | public static final String OAUTH_AUTHORIZE_FAILED_KEY = "OAuth2FailedMessage"; 6 | 7 | public static final String APP_STATUS_APPLY = "APPLY"; 8 | public static final String APP_STATUS_APPROVE = "APPROVE"; 9 | public static final String APP_STATUS_REJECT = "REJECT"; 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/js/app.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | 'use strict'; 3 | 4 | $(function() { 5 | var $fullText = $('.admin-fullText'); 6 | $('#admin-fullscreen').on('click', function() { 7 | $.AMUI.fullscreen.toggle(); 8 | }); 9 | 10 | $(document).on($.AMUI.fullscreen.raw.fullscreenchange, function() { 11 | $.AMUI.fullscreen.isFullscreen ? $fullText.text('关闭全屏') : $fullText.text('开启全屏'); 12 | }); 13 | }); 14 | })(jQuery); 15 | -------------------------------------------------------------------------------- /target/classes/ehcache/ehcache.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/resources/ehcache/ehcache.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/common/commonInclude.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld" %> 4 | <%@ taglib prefix="fn" uri="/WEB-INF/tlds/fn.tld" %> 5 | <%@ taglib prefix="fmt" uri="/WEB-INF/tlds/fmt.tld" %> 6 | <% 7 | String ctxPath = request.getContextPath(); 8 | //String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+ctxPath+"/"; 9 | String basePath = ctxPath+"/"; 10 | %> -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/common/footer.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | Insert title here 8 | 9 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/controller/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.servlet.ModelAndView; 6 | 7 | @Controller 8 | public class IndexController { 9 | 10 | @RequestMapping(value= {"", "/", "/index"}) 11 | public ModelAndView welcome(){ 12 | ModelAndView mav = new ModelAndView(); 13 | mav.setViewName("index"); 14 | return mav; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/dao/IAuthAppDao.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.favccxx.favauth.model.AuthApp; 6 | 7 | public interface IAuthAppDao extends IBaseDao{ 8 | 9 | /** 10 | * 根据应用网站代码查找应用网站信息 11 | * @param appKey 12 | * @return 13 | */ 14 | AuthApp findByAppKey(String appKey); 15 | 16 | /** 17 | * 根据应用网站状态查询第三方应用网站列表 18 | * 如appState为空对象或空字符串时则查询所有的应用网站列表 19 | * @param appState 20 | * @return 21 | */ 22 | List listByAppState(String appState); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/controller/api/ApiResourceController.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.controller.api; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.servlet.ModelAndView; 6 | 7 | @Controller 8 | @RequestMapping("api") 9 | public class ApiResourceController { 10 | 11 | @RequestMapping("initResource") 12 | public ModelAndView initRestResource(){ 13 | ModelAndView mav = new ModelAndView(); 14 | mav.setViewName("api/resource_list"); 15 | return mav; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/controller/welcome/WelcomeController.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.controller.welcome; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.servlet.ModelAndView; 6 | 7 | @Controller 8 | @RequestMapping("welcome") 9 | public class WelcomeController { 10 | 11 | @RequestMapping("welcome") 12 | public ModelAndView welcome(){ 13 | ModelAndView mav = new ModelAndView(); 14 | mav.setViewName("welcome/welcome"); 15 | return mav; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/login/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | Insert title here 8 | 9 | 10 |
11 | 12 | 13 | 14 |
15 | 16 | 17 |
18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/dao/IAuthClientDao.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.dao; 2 | 3 | import com.favccxx.favauth.model.AuthClient; 4 | 5 | public interface IAuthClientDao extends IBaseDao{ 6 | 7 | /** 8 | * 根据客户端Id删除客户端认证信息 9 | * @param clientId 10 | */ 11 | void deleteByClientId(String clientId); 12 | 13 | /** 14 | * 根据客户端Id查询认证客户端信息 15 | * @param clientId 16 | * @return 17 | */ 18 | AuthClient findByClientId(String clientId); 19 | 20 | /** 21 | * 根据密钥查询认证客户端信息 22 | * @param clientSecret 23 | * @return 24 | */ 25 | AuthClient findByClientSecret(String clientSecret); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.8 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 13 | org.eclipse.jdt.core.compiler.source=1.8 14 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/dao/impl/AuthUserDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.dao.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.stereotype.Repository; 6 | 7 | import com.favccxx.favauth.dao.IAuthUserDao; 8 | import com.favccxx.favauth.model.AuthUser; 9 | 10 | @Repository 11 | public class AuthUserDaoImpl extends BaseDaoImpl implements IAuthUserDao { 12 | 13 | @SuppressWarnings("unchecked") 14 | @Override 15 | public AuthUser findByUserName(String userName) { 16 | String hql = "from AuthUser where userName = ?"; 17 | List list = (List) hibernateTemplate.find(hql, userName); 18 | 19 | if(list!=null && list.size()>0) { 20 | return list.get(0); 21 | } 22 | 23 | return null; 24 | } 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/service/IAuthUserService.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.service; 2 | 3 | import com.favccxx.favauth.model.AuthUser; 4 | 5 | public interface IAuthUserService { 6 | 7 | /** 8 | * 新增用户 9 | * @param authUser 10 | * @return 11 | */ 12 | void save(AuthUser authUser); 13 | 14 | /** 15 | * 新增或更新用户 16 | * @param authUser 17 | * @return 18 | */ 19 | void saveOrUpdate(AuthUser authUser); 20 | 21 | /** 22 | * 删除用户 23 | * @param authUser 24 | */ 25 | void delete(AuthUser authUser); 26 | 27 | /** 28 | * 根据用户Id查找用户信息 29 | * @param id 30 | * @return 31 | */ 32 | AuthUser findById(long id); 33 | 34 | /** 35 | * 根据用户名查找用户信息 36 | * @param username 37 | * @return 38 | */ 39 | AuthUser findByUserName(String userName); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /target/classes/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | D:/favsecurity-$${sd:type}.log 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/service/IAuthAppService.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.service; 2 | 3 | import java.util.List; 4 | 5 | import com.favccxx.favauth.model.AuthApp; 6 | 7 | public interface IAuthAppService { 8 | 9 | /** 10 | * 新增第三方应用网站信息 11 | * @param authApp 12 | * @return 13 | */ 14 | void save(AuthApp authApp); 15 | 16 | /** 17 | * 新增或更新第三方应用网站信息 18 | * @param authApp 19 | * @return 20 | */ 21 | void saveOrUpdate(AuthApp authApp); 22 | 23 | /** 24 | * 删除第三方应用网站信息 25 | * @param authApp 26 | */ 27 | void delete(AuthApp authApp); 28 | 29 | /** 30 | * 根据应用网站ID查询应用网站信息 31 | * @param appId 32 | * @return 33 | */ 34 | AuthApp findByAppId(long appId); 35 | 36 | /** 37 | * 根据应用网站代码查找应用网站信息 38 | * @param appKey 39 | * @return 40 | */ 41 | AuthApp findByAppKey(String appKey); 42 | 43 | 44 | List listNeedAuthApps(); 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | D:/favsecurity-$${sd:type}.log 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/service/IAuthClientService.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.service; 2 | 3 | import com.favccxx.favauth.model.AuthClient; 4 | 5 | public interface IAuthClientService { 6 | 7 | /** 8 | * 新增认证客户端信息 9 | * @param authClient 10 | * @return 11 | */ 12 | void save(AuthClient authClient); 13 | 14 | /** 15 | * 新增或更新客户端信息 16 | * @param authClient 17 | * @return 18 | */ 19 | void saveOrUpdate(AuthClient authClient); 20 | 21 | /** 22 | * 删除客户端信息 23 | * @param authClient 24 | */ 25 | void delete(AuthClient authClient); 26 | 27 | /** 28 | * 根据客户端Id删除客户端信息 29 | * @param clientId 30 | */ 31 | void deleteByClientId(String clientId); 32 | 33 | /** 34 | * 根据客户端Id查询认证客户端信息 35 | * @param clientId 36 | * @return 37 | */ 38 | AuthClient findByClientId(String clientId); 39 | 40 | /** 41 | * 根据密钥查询认证客户端信息 42 | * @param clientSecret 43 | * @return 44 | */ 45 | AuthClient findByClientSecret(String clientSecret); 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /target/classes/spring/spring-config-cache.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/resources/spring/spring-config-cache.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /target/classes/database.properties: -------------------------------------------------------------------------------- 1 | 34 | -------------------------------------------------------------------------------- /src/main/resources/database.properties: -------------------------------------------------------------------------------- 1 | 34 | -------------------------------------------------------------------------------- /src/main/webapp/assets/js/equalcolumns.js: -------------------------------------------------------------------------------- 1 | function smartColumns() { //Create a function that calculates the smart columns 2 | 3 | //Reset column size to a 100% once view port has been adjusted 4 | $("ul.column").css({ 'width' : "100%"}); 5 | 6 | var colWrap = $("ul.column").width(); //Get the width of row 7 | var colNum = Math.floor(colWrap / 200); //Find how many columns of 200px can fit per row / then round it down to a whole number 8 | var colFixed = Math.floor(colWrap / colNum); //Get the width of the row and divide it by the number of columns it can fit / then round it down to a whole number. This value will be the exact width of the re-adjusted column 9 | 10 | $("ul.column").css({ 'width' : colWrap}); //Set exact width of row in pixels instead of using % - Prevents cross-browser bugs that appear in certain view port resolutions. 11 | $("ul.column li").css({ 'width' : colFixed}); //Set exact width of the re-adjusted column 12 | 13 | } 14 | 15 | smartColumns();//Execute the function when page loads 16 | 17 | $(window).resize(function () { //Each time the viewport is adjusted/resized, execute the function 18 | smartColumns(); 19 | }); 20 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/service/impl/AuthUserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.service.impl; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.favccxx.favauth.dao.IAuthUserDao; 7 | import com.favccxx.favauth.model.AuthUser; 8 | import com.favccxx.favauth.service.IAuthUserService; 9 | 10 | @Service 11 | public class AuthUserServiceImpl implements IAuthUserService { 12 | 13 | @Autowired 14 | IAuthUserDao authUserDao; 15 | 16 | @Override 17 | public void save(AuthUser authUser) { 18 | authUserDao.save(authUser); 19 | } 20 | 21 | @Override 22 | public void saveOrUpdate(AuthUser authUser) { 23 | authUserDao.saveOrUpdate(authUser); 24 | } 25 | 26 | @Override 27 | public void delete(AuthUser authUser) { 28 | authUserDao.delete(authUser); 29 | } 30 | 31 | @Override 32 | public AuthUser findById(long id) { 33 | return authUserDao.load(id); 34 | } 35 | 36 | @Override 37 | public AuthUser findByUserName(String userName) { 38 | return authUserDao.findByUserName(userName); 39 | } 40 | 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/dao/IBaseDao.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.dao; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | public interface IBaseDao { 7 | 8 | /** 9 | * 根据Id获取对象实例 10 | * 11 | * @param id 12 | * @return 13 | */ 14 | public T load(Serializable id); 15 | 16 | /** 17 | * 查询所有的对象列表 18 | * 19 | * @return 20 | */ 21 | public List loadAll(); 22 | 23 | /** 24 | * 新增对象实例 25 | * 26 | * @param entity 27 | */ 28 | public void save(T entity); 29 | 30 | /** 31 | * 删除对象实例 32 | * 33 | * @param entity 34 | */ 35 | public void delete(T entity); 36 | 37 | /** 38 | * 更新对象实例 39 | * 40 | * @param entity 41 | */ 42 | public void update(T entity); 43 | 44 | /** 45 | * 新增或保存对象实例 46 | * 47 | * @param entity 48 | */ 49 | public void saveOrUpdate(T entity); 50 | 51 | /** 52 | * HQL查询 53 | * @param hql 54 | * @return 55 | */ 56 | public List find(String hql); 57 | 58 | /** 59 | * 带参数的HQL查询 60 | * @param hql 61 | * @param params 62 | * @return 63 | */ 64 | public List find(String hql, Object... params); 65 | 66 | } 67 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/dao/impl/AuthAppDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.dao.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.commons.lang3.StringUtils; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.favccxx.favauth.dao.IAuthAppDao; 9 | import com.favccxx.favauth.model.AuthApp; 10 | 11 | @Repository 12 | public class AuthAppDaoImpl extends BaseDaoImpl implements IAuthAppDao { 13 | 14 | @SuppressWarnings("unchecked") 15 | @Override 16 | public AuthApp findByAppKey(String appKey) { 17 | String hql = "from AuthApp where appKey=?"; 18 | List list = (List) hibernateTemplate.find(hql, appKey); 19 | if(list!=null && list.size()>0) { 20 | return list.get(0); 21 | } 22 | return null; 23 | } 24 | 25 | @SuppressWarnings("unchecked") 26 | @Override 27 | public List listByAppState(String appState) { 28 | if(StringUtils.isBlank(appState)) { 29 | String hql = "from AuthApp"; 30 | List list = (List) hibernateTemplate.find(hql); 31 | return list; 32 | } 33 | String hql = "from AuthApp where appState=?"; 34 | List list = (List) hibernateTemplate.find(hql, appState); 35 | return list; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/dao/impl/AuthClientDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.dao.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.stereotype.Repository; 6 | 7 | import com.favccxx.favauth.dao.IAuthClientDao; 8 | import com.favccxx.favauth.model.AuthClient; 9 | 10 | @Repository 11 | public class AuthClientDaoImpl extends BaseDaoImpl implements IAuthClientDao { 12 | 13 | @Override 14 | public void deleteByClientId(String clientId) { 15 | AuthClient authClient = findByClientId(clientId); 16 | hibernateTemplate.delete(authClient); 17 | } 18 | 19 | @SuppressWarnings("unchecked") 20 | @Override 21 | public AuthClient findByClientId(String clientId) { 22 | String hql = "from AuthClient where clientId=?"; 23 | List list = (List) hibernateTemplate.find(hql, clientId); 24 | if(list!=null && list.size()>0) { 25 | return list.get(0); 26 | } 27 | 28 | return null; 29 | } 30 | 31 | @SuppressWarnings("unchecked") 32 | @Override 33 | public AuthClient findByClientSecret(String clientSecret) { 34 | String hql = "from AuthClient where clientSecret=?"; 35 | List list = (List) hibernateTemplate.find(hql, clientSecret); 36 | if(list!=null) { 37 | return list.get(0); 38 | } 39 | 40 | return null; 41 | } 42 | 43 | 44 | 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/resources/springmvc/spring-mvc.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /target/classes/springmvc/spring-mvc.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/service/IFavAuthService.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.service; 2 | 3 | public interface IFavAuthService { 4 | 5 | /** 6 | * 添加授权代码 7 | * @param authCode 授权代码 8 | * @param username 用户名 9 | */ 10 | public void addAuthCode(String authCode, String username); 11 | 12 | /** 13 | * 添加访问令牌 14 | * @param accessToken 访问令牌 15 | * @param username 用户名 16 | */ 17 | public void addAccessToken(String accessToken, String username); 18 | 19 | /** 20 | * 验证授权代码是否有效 21 | * @param authCode 授权代码 22 | * @return 23 | */ 24 | boolean checkAuthCode(String authCode); 25 | 26 | /** 27 | * 验证访问令牌是否有效 28 | * @param accessToken 访问令牌 29 | * @return 30 | */ 31 | boolean checkAccessToken(String accessToken); 32 | 33 | /** 34 | * 根据授权代码获取用户名 35 | * @param authCode 36 | * @return 37 | */ 38 | String getUsernameByAuthCode(String authCode); 39 | 40 | /** 41 | * 根据令牌获取用户名 42 | * @param accessToken 43 | * @return 44 | */ 45 | String getUsernameByAccessToken(String accessToken); 46 | 47 | /** 48 | * 获取授权代码/令牌过期时间 49 | * @return 50 | */ 51 | long getExpireIn(); 52 | 53 | /** 54 | * 检查客户端Id是否存在 55 | * @param clientId 客户端Id 56 | * @return 57 | */ 58 | public boolean checkClientId(String clientId); 59 | 60 | /** 61 | * 检查客户端安全Key是否存在 62 | * @param clientSecret 63 | * @return 64 | */ 65 | public boolean checkClientSecret(String clientSecret); 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/service/IAuthVerifyService.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.service; 2 | 3 | public interface IAuthVerifyService { 4 | 5 | /** 6 | * 添加授权代码 7 | * 8 | * @param authCode 9 | * 授权代码 10 | * @param username 11 | * 用户名 12 | */ 13 | void addAuthCode(String authCode, String username); 14 | 15 | 16 | /** 17 | * 根据授权码获取登陆用户的用户名 18 | * @param authCode 19 | * @return 20 | */ 21 | String getUsernameByAuthCode(String authCode); 22 | 23 | /** 24 | * 验证授权代码是否有效 25 | * 26 | * @param authCode 27 | * 授权代码 28 | * @return 29 | */ 30 | boolean checkAuthCode(String authCode); 31 | 32 | 33 | /** 34 | * 添加访问令牌 35 | * @param accessToken 访问令牌 36 | * @param username 用户名 37 | */ 38 | void addAccessToken(String accessToken, String username); 39 | 40 | /** 41 | * 验证访问令牌是否有效 42 | * @param accessToken 访问令牌 43 | * @return 44 | */ 45 | boolean checkAccessToken(String accessToken); 46 | 47 | /** 48 | * 根据令牌获取用户名 49 | * @param accessToken 50 | * @return 51 | */ 52 | String getUsernameByAccessToken(String accessToken); 53 | 54 | 55 | 56 | /** 57 | * 校验客户端密钥是否正确 58 | * 59 | * @param clientSecret 60 | * @return 61 | */ 62 | boolean checkClientSecret(String clientSecret); 63 | 64 | 65 | 66 | /** 67 | * 获取授权代码/令牌过期时间 68 | * @return 69 | */ 70 | long getExpireIn(); 71 | 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/service/impl/AuthClientServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.service.impl; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import org.springframework.transaction.annotation.Transactional; 6 | 7 | import com.favccxx.favauth.dao.IAuthClientDao; 8 | import com.favccxx.favauth.model.AuthClient; 9 | import com.favccxx.favauth.service.IAuthClientService; 10 | 11 | @Service 12 | public class AuthClientServiceImpl implements IAuthClientService { 13 | 14 | @Autowired 15 | IAuthClientDao authClientDao; 16 | 17 | @Transactional 18 | @Override 19 | public void save(AuthClient authClient) { 20 | authClientDao.save(authClient); 21 | } 22 | 23 | @Transactional 24 | @Override 25 | public void saveOrUpdate(AuthClient authClient) { 26 | authClientDao.saveOrUpdate(authClient); 27 | } 28 | 29 | @Transactional 30 | @Override 31 | public void delete(AuthClient authClient) { 32 | authClientDao.delete(authClient); 33 | } 34 | 35 | @Transactional 36 | @Override 37 | public void deleteByClientId(String clientId) { 38 | authClientDao.deleteByClientId(clientId); 39 | } 40 | 41 | @Override 42 | public AuthClient findByClientId(String clientId) { 43 | return authClientDao.findByClientId(clientId); 44 | } 45 | 46 | @Override 47 | public AuthClient findByClientSecret(String clientSecret) { 48 | return authClientDao.findByClientSecret(clientSecret); 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/controller/login/OAuth2LoginController.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.controller.login; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.util.StringUtils; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.servlet.ModelAndView; 10 | 11 | import com.favccxx.favauth.model.AuthApp; 12 | import com.favccxx.favauth.service.IAuthAppService; 13 | 14 | @Controller 15 | @RequestMapping("oauth2") 16 | public class OAuth2LoginController { 17 | 18 | @Autowired 19 | IAuthAppService authAppService; 20 | 21 | /** 22 | * 可以进行OAuth2认证登录的应用页面 23 | * @return 24 | */ 25 | @RequestMapping(value={"initOAuth2LoginApp"}) 26 | public ModelAndView initOAuth2LoginApp(){ 27 | ModelAndView mav = new ModelAndView(); 28 | List appList = authAppService.listNeedAuthApps(); 29 | mav.addObject("appList", appList); 30 | mav.setViewName("oauth2/oauth2_login_app"); 31 | return mav; 32 | } 33 | 34 | 35 | @RequestMapping(value={"initOAuth2Login"}) 36 | public ModelAndView initOAuth2Login(String appId){ 37 | ModelAndView mav = new ModelAndView(); 38 | if(!StringUtils.isEmpty(appId)){ 39 | AuthApp authApp = authAppService.findByAppId(Long.valueOf(appId)); 40 | mav.addObject("authApp", authApp); 41 | } 42 | mav.setViewName("oauth2/oauth2_login"); 43 | return mav; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | FavOAuth2 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.validation.validationbuilder 20 | 21 | 22 | 23 | 24 | org.springframework.ide.eclipse.core.springbuilder 25 | 26 | 27 | 28 | 29 | org.springframework.ide.eclipse.boot.validation.springbootbuilder 30 | 31 | 32 | 33 | 34 | org.eclipse.m2e.core.maven2Builder 35 | 36 | 37 | 38 | 39 | 40 | org.springframework.ide.eclipse.core.springnature 41 | org.eclipse.jem.workbench.JavaEMFNature 42 | org.eclipse.wst.common.modulecore.ModuleCoreNature 43 | org.eclipse.jdt.core.javanature 44 | org.eclipse.m2e.core.maven2Nature 45 | org.eclipse.wst.common.project.facet.core.nature 46 | org.eclipse.wst.jsdt.core.jsNature 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/main/webapp/assets/css/oauth_error.css: -------------------------------------------------------------------------------- 1 | .oauth_wrap { 2 | margin: 0 auto; 3 | width: 580px; 4 | } 5 | 6 | .clearfix::after { 7 | clear: both; 8 | content: "."; 9 | display: block; 10 | height: 0; 11 | visibility: hidden; 12 | } 13 | .oauth_header { 14 | margin-bottom: 11px; 15 | } 16 | .clearfix { 17 | display: block; 18 | } 19 | 20 | 21 | .WB_panel { 22 | background: -moz-linear-gradient(center top , #fff 0px, #fbfbfb 80%, #f5f5f5 100%) repeat scroll 0 0 rgba(0, 0, 0, 0); 23 | border: 1px solid #d2d2d2; 24 | border-radius: 6px; 25 | box-shadow: 0 0 5px rgba(198, 198, 198, 1); 26 | overflow: hidden; 27 | } 28 | 29 | .oauth_error .oauth_error_content { 30 | margin: 0 0 0 150px; 31 | padding: 85px 0 111px; 32 | width: 315px; 33 | } 34 | .oauth_error .oauth_error_content .oauth_error_icon, .oauth_error .error_content { 35 | float: left; 36 | } 37 | .oauth_error .oauth_error_content .oauth_error_icon { 38 | margin-right: 10px; 39 | } 40 | .oauth_error .oauth_error_content .error_content { 41 | line-height: 21px; 42 | width: 265px; 43 | } 44 | .oauth_error .error_content dt { 45 | color: #646464; 46 | font-size: 16px; 47 | font-weight: bold; 48 | } 49 | .oauth_error .error_content dd { 50 | font-size: 12px; 51 | margin-top: 7px; 52 | } 53 | .oauth_error .error_content dd a { 54 | margin-right: 5px; 55 | } 56 | .oauth_error .oauth_copyright { 57 | background: none repeat scroll 0 0 #e4e4e4; 58 | border-radius: 0 0 8px 8px; 59 | font-size: 12px; 60 | height: 25px; 61 | line-height: 25px; 62 | text-align: center; 63 | } 64 | .oauth_error .oauth_copyright a { 65 | margin-right: 5px; 66 | } -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/dao/impl/BaseDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.dao.impl; 2 | 3 | import java.io.Serializable; 4 | import java.lang.reflect.ParameterizedType; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.orm.hibernate5.HibernateTemplate; 9 | 10 | import com.favccxx.favauth.dao.IBaseDao; 11 | 12 | public class BaseDaoImpl implements IBaseDao { 13 | 14 | private Class entityClass; 15 | 16 | @Autowired 17 | protected HibernateTemplate hibernateTemplate; 18 | 19 | @SuppressWarnings("unchecked") 20 | public BaseDaoImpl() { 21 | ParameterizedType genType = (ParameterizedType) this.getClass().getGenericSuperclass(); 22 | entityClass = (Class) genType.getActualTypeArguments()[0]; 23 | } 24 | 25 | @Override 26 | public T load(Serializable id) { 27 | return (T) hibernateTemplate.load(entityClass, id); 28 | } 29 | 30 | @Override 31 | public List loadAll() { 32 | return hibernateTemplate.loadAll(entityClass); 33 | } 34 | 35 | @Override 36 | public void save(T entity) { 37 | hibernateTemplate.save(entity); 38 | } 39 | 40 | @Override 41 | public void delete(T entity) { 42 | hibernateTemplate.delete(entity); 43 | } 44 | 45 | @Override 46 | public void update(T entity) { 47 | hibernateTemplate.update(entity); 48 | } 49 | 50 | @Override 51 | public void saveOrUpdate(T entity) { 52 | hibernateTemplate.saveOrUpdate(entity); 53 | } 54 | 55 | @Override 56 | public List find(String hql) { 57 | return hibernateTemplate.find(hql); 58 | } 59 | 60 | 61 | @Override 62 | public List find(String hql, Object... params) { 63 | return hibernateTemplate.find(hql, params); 64 | } 65 | 66 | 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/service/impl/AuthVerifyServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.service.impl; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.cache.Cache; 5 | import org.springframework.cache.CacheManager; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.favccxx.favauth.dao.IAuthClientDao; 9 | import com.favccxx.favauth.service.IAuthVerifyService; 10 | 11 | @Service 12 | public class AuthVerifyServiceImpl implements IAuthVerifyService { 13 | 14 | private Cache cache; 15 | 16 | @Autowired 17 | IAuthClientDao authClientDao; 18 | 19 | public AuthVerifyServiceImpl(CacheManager cacheManager){ 20 | this.cache = cacheManager.getCache("code-cache"); 21 | } 22 | 23 | @Override 24 | public void addAuthCode(String authCode, String username) { 25 | cache.put(authCode, username); 26 | } 27 | 28 | @Override 29 | public boolean checkClientSecret(String clientSecret) { 30 | return authClientDao.findByClientSecret(clientSecret) != null; 31 | } 32 | 33 | @Override 34 | public boolean checkAuthCode(String authCode) { 35 | return cache.get(authCode) != null; 36 | } 37 | 38 | @Override 39 | public long getExpireIn() { 40 | return 3600L; 41 | } 42 | 43 | @Override 44 | public String getUsernameByAuthCode(String authCode) { 45 | return (String)cache.get(authCode).get(); 46 | } 47 | 48 | @Override 49 | public void addAccessToken(String accessToken, String username) { 50 | cache.put(accessToken, username); 51 | } 52 | 53 | @Override 54 | public boolean checkAccessToken(String accessToken) { 55 | return cache.get(accessToken) != null; 56 | } 57 | 58 | @Override 59 | public String getUsernameByAccessToken(String accessToken) { 60 | return (String)cache.get(accessToken).get(); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/common/header.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 14 | 15 |
16 |
17 | OAuth 2.0 授权管理系统 18 |
19 | 20 | 21 | 22 |
23 | 24 | 38 |
39 |
40 | 41 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/model/AuthClient.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.model; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.SequenceGenerator; 11 | import javax.persistence.Table; 12 | 13 | /** 14 | * 授权客户端实体类 15 | * 只有数据库中存在的客户端站点才有资格申请访问服务器的资源 16 | * @author favccxx 17 | * 18 | */ 19 | @Entity 20 | @Table(name = "FAV_AUTH_CLIENT") 21 | public class AuthClient implements Serializable { 22 | 23 | /** 24 | * 25 | */ 26 | private static final long serialVersionUID = 1L; 27 | 28 | @Id 29 | @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="authClientSeq") 30 | @SequenceGenerator(name="authClientSeq", initialValue = 1, allocationSize = 1, sequenceName = "FAV_AUTH_CLIENT_SEQ" ) 31 | @Column(name = "ID") 32 | private Long id; 33 | 34 | /** 35 | * 客户端Id 36 | */ 37 | @Column(name = "CLIENT_ID") 38 | private String clientId; 39 | 40 | /** 41 | * 客户端名称 42 | */ 43 | @Column(name = "CLIENT_NAME") 44 | private String clientName; 45 | 46 | /** 47 | * 客户端密钥 48 | */ 49 | @Column(name = "CLIENT_SECRET") 50 | private String clientSecret; 51 | 52 | 53 | public Long getId() { 54 | return id; 55 | } 56 | 57 | public void setId(Long id) { 58 | this.id = id; 59 | } 60 | 61 | public String getClientId() { 62 | return clientId; 63 | } 64 | 65 | public void setClientId(String clientId) { 66 | this.clientId = clientId; 67 | } 68 | 69 | public String getClientName() { 70 | return clientName; 71 | } 72 | 73 | public void setClientName(String clientName) { 74 | this.clientName = clientName; 75 | } 76 | 77 | public String getClientSecret() { 78 | return clientSecret; 79 | } 80 | 81 | public void setClientSecret(String clientSecret) { 82 | this.clientSecret = clientSecret; 83 | } 84 | 85 | 86 | 87 | } 88 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/client/auth_user.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ include file="../common/commonInclude.jsp"%> 4 | 5 | 6 | 7 | 8 | 9 | OAuth2.0认证成功 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 32 | 33 |
34 | 35 |
36 | 37 |
38 |
站点管理 / 用户认证
39 |
40 | 41 | 42 | 43 |
44 |
45 |

恭喜【 ${userName } 】,你已经通过OAuth2.0认证

46 |
47 | 48 |
49 |
50 | 51 |
52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/controller/client/AuthResourceClientController.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.controller.client; 2 | 3 | import org.apache.oltu.oauth2.client.OAuthClient; 4 | import org.apache.oltu.oauth2.client.URLConnectionClient; 5 | import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; 6 | import org.apache.oltu.oauth2.client.request.OAuthClientRequest; 7 | import org.apache.oltu.oauth2.client.response.OAuthResourceResponse; 8 | import org.apache.oltu.oauth2.common.OAuth; 9 | import org.apache.oltu.oauth2.common.exception.OAuthProblemException; 10 | import org.apache.oltu.oauth2.common.exception.OAuthSystemException; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.servlet.ModelAndView; 14 | 15 | /** 16 | * 根据访问令牌获取登录用户信息 17 | * 18 | * @author favccxx 19 | * 20 | */ 21 | @Controller 22 | @RequestMapping("client") 23 | public class AuthResourceClientController { 24 | 25 | @RequestMapping(value="/applyAuthUser", produces = "text/html;charset=UTF-8") 26 | public ModelAndView applyAuthUser(String accessToken) { 27 | ModelAndView mav = new ModelAndView(); 28 | // 资源认证服务器 29 | String authResourceServer = "http://localhost:8080/FavOAuth2/server/authUserInfo"; 30 | OAuthClient oAuthClient = new OAuthClient(new URLConnectionClient()); 31 | OAuthClientRequest authUserRequest; 32 | try { 33 | authUserRequest = new OAuthBearerClientRequest(authResourceServer).setAccessToken(accessToken).buildQueryMessage(); 34 | 35 | OAuthResourceResponse resourceResponse = oAuthClient.resource(authUserRequest, OAuth.HttpMethod.GET, 36 | OAuthResourceResponse.class); 37 | 38 | String userName = resourceResponse.getBody(); 39 | System.out.println(userName); 40 | 41 | 42 | mav.addObject("userName", userName); 43 | mav.setViewName("client/auth_user"); 44 | 45 | } catch (OAuthSystemException e) { 46 | 47 | e.printStackTrace(); 48 | } catch (OAuthProblemException e) { 49 | e.printStackTrace(); 50 | } 51 | 52 | return mav; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/service/impl/AuthAppServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import com.favccxx.favauth.constants.OAuth2Constants; 10 | import com.favccxx.favauth.dao.IAuthAppDao; 11 | import com.favccxx.favauth.dao.IAuthClientDao; 12 | import com.favccxx.favauth.model.AuthApp; 13 | import com.favccxx.favauth.model.AuthClient; 14 | import com.favccxx.favauth.service.IAuthAppService; 15 | 16 | @Service 17 | public class AuthAppServiceImpl implements IAuthAppService { 18 | 19 | @Autowired 20 | IAuthAppDao authAppDao; 21 | @Autowired 22 | IAuthClientDao authClientDao; 23 | 24 | @Transactional 25 | @Override 26 | public void save(AuthApp authApp) { 27 | authAppDao.save(authApp); 28 | } 29 | 30 | @Transactional 31 | @Override 32 | public void saveOrUpdate(AuthApp authApp) { 33 | authAppDao.saveOrUpdate(authApp); 34 | 35 | //当应用网站状态为APPROVED时,将应用网站注册到认证客户端 36 | if(authApp.getAppState()!=null && OAuth2Constants.APP_STATUS_APPROVE.equals(authApp.getAppState())) { 37 | AuthClient authClient = authClientDao.findByClientId(authApp.getAppKey()); 38 | if(authClient == null) { 39 | authClient = new AuthClient(); 40 | authClient.setClientId(authApp.getAppKey()); 41 | authClient.setClientName(authApp.getAppName()); 42 | authClient.setClientSecret("xxxxxxx"); 43 | authClientDao.save(authClient); 44 | } 45 | } 46 | 47 | } 48 | 49 | @Transactional 50 | @Override 51 | public void delete(AuthApp authApp) { 52 | authAppDao.delete(authApp); 53 | } 54 | 55 | 56 | 57 | @Override 58 | public AuthApp findByAppKey(String appKey) { 59 | return authAppDao.findByAppKey(appKey); 60 | } 61 | 62 | @Override 63 | public List listNeedAuthApps() { 64 | return authAppDao.listByAppState(""); 65 | } 66 | 67 | @Override 68 | public AuthApp findByAppId(long appId) { 69 | return authAppDao.load(appId); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | FavOAuth2 4 | 5 | contextConfigLocation 6 | classpath:spring/spring-config.xml 7 | 8 | 9 | encodingFilter 10 | org.springframework.web.filter.CharacterEncodingFilter 11 | 12 | encoding 13 | UTF-8 14 | 15 | 16 | forceEncoding 17 | true 18 | 19 | 20 | 21 | encodingFilter 22 | /* 23 | 24 | 25 | openSessionInView 26 | org.springframework.orm.hibernate5.support.OpenSessionInViewFilter 27 | 28 | 29 | openSessionInView 30 | /* 31 | 32 | 33 | org.springframework.web.context.ContextLoaderListener 34 | 35 | 36 | springMVC 37 | org.springframework.web.servlet.DispatcherServlet 38 | 39 | contextConfigLocation 40 | classpath*:springmvc/spring-mvc.xml 41 | 42 | 1 43 | 44 | 45 | springMVC 46 | / 47 | 48 | 49 | index.jsp 50 | 51 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/oauth2/oauth2_authorize_fail.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ include file="../common/commonInclude.jsp"%> 4 | 5 | 6 | 7 | 8 | 9 | OAuth 2.0登陆 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 32 | 33 | 34 | 35 |
36 |
37 |

微博

38 | 39 |
40 | 41 |
42 |
43 |
44 |
45 |
访问出错了!
46 |
你所访问的站点在高富帅的认证失败,请你联系 系统管理员 或者稍后再试。
47 | (error:redirect_uri_mismatch)${OAuth2FailedMessage } 48 |
49 |
50 |
51 | 52 |
53 |
54 |
55 | 56 | -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Login Page | Amaze UI Example 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 26 | 27 | 28 |
29 |
30 |

Web ide

31 |

Integrated Development Environment
代码编辑,代码生成,界面设计,调试,编译

32 |
33 |
34 |
35 |
36 |
37 |

登录

38 |
39 |
40 | Github 41 | Google+ 42 | stackOverflow 43 |
44 |
45 |
46 | 47 |
48 | 49 | 50 |
51 | 52 | 53 |
54 | 58 |
59 |
60 | 61 | 62 |
63 |
64 |
65 |

© 2014 AllMobilize, Inc. Licensed under MIT license.

66 |
67 |
68 | 69 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/controller/site/AppSiteController.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.controller.site; 2 | 3 | import java.util.List; 4 | import java.util.UUID; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.ResponseBody; 10 | import org.springframework.web.servlet.ModelAndView; 11 | 12 | import com.alibaba.fastjson.JSON; 13 | import com.favccxx.favauth.constants.OAuth2Constants; 14 | import com.favccxx.favauth.model.AuthApp; 15 | import com.favccxx.favauth.service.IAuthAppService; 16 | 17 | /** 18 | * 第三方应用网站授权管理 19 | * 1. 第三方应用网站管理员在OAuth2.0服务器填写需要申请授权访问的网站 20 | * 2. OAuth2.0服务器管理员进入后台审批系统对第三方应用网站进行审核授权 21 | * 3. 对于授权的站点,颁发认证信息 22 | * @author favccxx 23 | * 24 | */ 25 | @Controller 26 | @RequestMapping("site") 27 | public class AppSiteController { 28 | 29 | @Autowired 30 | IAuthAppService authAppService; 31 | 32 | /** 33 | * 加载第三方应用申请授权页面 34 | * @return 35 | */ 36 | @RequestMapping("initApplySite") 37 | public ModelAndView initApplySite(){ 38 | ModelAndView mav = new ModelAndView(); 39 | String appKey = UUID.randomUUID().toString(); 40 | mav.addObject("appKey", appKey); 41 | mav.setViewName("site/site_apply"); 42 | 43 | return mav; 44 | } 45 | 46 | //查询需要授权的应用站点 47 | @RequestMapping("initNeedApproveSite") 48 | public ModelAndView initNeedApproveSite(){ 49 | ModelAndView mav = new ModelAndView(); 50 | List appList = authAppService.listNeedAuthApps(); 51 | mav.addObject("appList", appList); 52 | mav.setViewName("site/site_approval"); 53 | 54 | return mav; 55 | } 56 | 57 | 58 | @RequestMapping(value="/approveAppSite",produces = {"application/json;charset=UTF-8"}) 59 | @ResponseBody 60 | public String approveAppSite(String appId, String appState){ 61 | AuthApp authApp = authAppService.findByAppId(Long.valueOf(appId)); 62 | if(authApp!=null){ 63 | authApp.setAppState(appState); 64 | authAppService.saveOrUpdate(authApp); 65 | } 66 | return JSON.toJSONString("success"); 67 | } 68 | 69 | 70 | 71 | @RequestMapping(value="/addAppSite", produces = {"application/json;charset=UTF-8"}) 72 | @ResponseBody 73 | public String addAppSite(AuthApp authApp){ 74 | ModelAndView mav = new ModelAndView(); 75 | authApp.setAppState(OAuth2Constants.APP_STATUS_APPLY); 76 | mav.setViewName("webapply/web_application"); 77 | authAppService.save(authApp); 78 | return JSON.toJSONString("success"); 79 | } 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/model/AuthApp.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.model; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.SequenceGenerator; 11 | import javax.persistence.Table; 12 | 13 | /** 14 | * 第三方应用网站实体类 15 | * 记录第三方网站的基本信息 16 | * @author favccxx 17 | * 18 | */ 19 | @Entity 20 | @Table(name = "FAV_AUTH_APP") 21 | public class AuthApp implements Serializable { 22 | 23 | /** 24 | * 25 | */ 26 | private static final long serialVersionUID = 1L; 27 | 28 | @Id 29 | @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="authAppSeq") 30 | @SequenceGenerator(name="authAppSeq", initialValue = 1, allocationSize = 1, sequenceName = "FAV_AUTH_APP_SEQ" ) 31 | @Column(name = "ID") 32 | private Long id; 33 | 34 | /** 35 | * 应用网站代码 36 | */ 37 | private String appKey; 38 | 39 | /** 40 | * 应用网站名称 41 | */ 42 | private String appName; 43 | 44 | /** 45 | * 应用网站简介 46 | */ 47 | private String appProfile; 48 | 49 | /** 50 | * 应用网站分类 51 | */ 52 | private String appCategory; 53 | 54 | /** 55 | * 应用网站地址 56 | */ 57 | private String appUrl; 58 | 59 | /** 60 | * 应用网站状态 61 | */ 62 | private String appState; 63 | 64 | public Long getId() { 65 | return id; 66 | } 67 | 68 | public void setId(Long id) { 69 | this.id = id; 70 | } 71 | 72 | public String getAppKey() { 73 | return appKey; 74 | } 75 | 76 | public void setAppKey(String appKey) { 77 | this.appKey = appKey; 78 | } 79 | 80 | public String getAppName() { 81 | return appName; 82 | } 83 | 84 | public void setAppName(String appName) { 85 | this.appName = appName; 86 | } 87 | 88 | public String getAppProfile() { 89 | return appProfile; 90 | } 91 | 92 | public void setAppProfile(String appProfile) { 93 | this.appProfile = appProfile; 94 | } 95 | 96 | public String getAppCategory() { 97 | return appCategory; 98 | } 99 | 100 | public void setAppCategory(String appCategory) { 101 | this.appCategory = appCategory; 102 | } 103 | 104 | public String getAppUrl() { 105 | return appUrl; 106 | } 107 | 108 | public void setAppUrl(String appUrl) { 109 | this.appUrl = appUrl; 110 | } 111 | 112 | public String getAppState() { 113 | return appState; 114 | } 115 | 116 | public void setAppState(String appState) { 117 | this.appState = appState; 118 | } 119 | 120 | 121 | 122 | 123 | 124 | } 125 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/common/commonMenu.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 |
6 |
7 | 32 |
33 | 34 | 35 | 36 | 37 | 38 |
39 | 40 | 41 | -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/js/polyfill/rem.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module: rem - v1.3.2 3 | * Description: A polyfill to parse CSS links and rewrite pixel equivalents into head for non supporting browsers 4 | * Date Built: 2014-07-02 5 | * Copyright (c) 2014 | Chuck Carpenter ,Lucas Serven ; 6 | **/ 7 | !function(a){"use strict";var b=function(){var a=document.createElement("div");return a.style.cssText="font-size: 1rem;",/rem/.test(a.style.fontSize)},c=function(){for(var a=document.getElementsByTagName("link"),b=[],c=0;c0?(r=[],q=[],n=[],d()):g()}},f=function(a,b){for(var c,d=k(a).replace(/\/\*[\s\S]*?\*\//g,""),e=/[\w\d\s\-\/\\\[\]:,.'"*()<>+~%#^$_=|@]+\{[\w\d\s\-\/\\%#:!;,.'"*()]+\d*\.?\d+rem[\w\d\s\-\/\\%#:!;,.'"*()]*\}/g,f=d.match(e),g=/\d*\.?\d+rem/g,h=d.match(g),i=/(.*\/)/,j=i.exec(b)[0],l=/@import (?:url\()?['"]?([^'\)"]*)['"]?\)?[^;]*/gm;null!==(c=l.exec(a));)n.push(j+c[1]);null!==f&&0!==f.length&&(o=o.concat(f),p=p.concat(h))},g=function(){for(var a=/[\w\d\s\-\/\\%#:,.'"*()]+\d*\.?\d+rem[\w\d\s\-\/\\%#:!,.'"*()]*[;}]/g,b=0;b paramMap = new HashMap(); 57 | paramMap.put(OAuth.OAUTH_STATE, "123"); 58 | paramMap.put(OAuth.OAUTH_SCOPE, "RRR"); 59 | paramMap.put(OAuth.OAUTH_REDIRECT_URI, "ding.com"); 60 | paramMap.put(OAuth.OAUTH_GRANT_TYPE, String.valueOf(GrantType.AUTHORIZATION_CODE)); 61 | paramMap.put(OAuth.OAUTH_CLIENT_ID, clientId); 62 | paramMap.put(OAuth.OAUTH_CODE, authCode); 63 | paramMap.put(OAuth.OAUTH_CLIENT_SECRET, clientSecret); 64 | paramMap.put(OAuth.OAUTH_REDIRECT_URI, redirectUrl); 65 | paramMap.put(OAuth.OAUTH_USERNAME, userName); 66 | 67 | String accessToken = HttpClientUtils.doPost(url, paramMap); 68 | 69 | mav.addObject("accessToken", accessToken); 70 | mav.setViewName("redirect:http://localhost:8080/FavOAuth2/client/applyAuthUser"); 71 | 72 | } 73 | 74 | return mav; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/api/resource_list.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ include file="../common/commonInclude.jsp"%> 4 | 5 | 6 | 7 | 8 | 9 | REST API 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 32 | 33 | 34 | 35 |
36 |
37 |
REST API / 使用說明
38 |
39 | 40 |
41 | 42 |
43 |
44 |

用戶管理接口

45 |

users/behavior_trend获取授权用户行为数据每日变化趋势

46 |

friendships/followers/trend_count获取30天授权用户粉丝的变化趋势数据

47 |

friendships/followers/active_list获取授权用户活跃或互动粉丝TOP20列表

48 |
49 |
50 | 51 |
52 |

检索最新数据

53 |

search/statuses/limited 搜索含某关键词的微博

54 |

search/statuses/limited Search for weibos

55 |
    56 |
  1. 在 GitHub 项目主页提交 Issue
  2. 57 |
  3. 在 GitHub 项目主页提交 Issue
  4. 58 |
59 |

反馈注意事项

60 |

为了能最准确的传达所描述的问题, 建议你在反馈时附上演示,方便我们理解。

61 |

下面的几个链接是我们在几个在线调试工具上建的页面, 已经引入了 Amaze UI 样式和脚本,你可以选择你喜欢的工具【Fork】一份, 把要有问题的场景粘在里面,反馈给我们。

62 |
    63 |
  1. JSBin
  2. 64 |
  3. JSFiddle
  4. 65 |
  5. CodePen
  6. 66 |
67 |
68 |
69 |
70 | 71 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ include file="common/commonInclude.jsp"%> 4 | 5 | 6 | 7 | 8 | 9 | OAuth 2.0授权管理系统 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 39 | 40 | 41 | 45 | 46 |
47 | <%@ include file="common/header.jsp"%> 48 |
49 |
50 |
51 | <%@ include file="common/commonMenu.jsp"%> 52 |
53 |
54 | 55 |
56 |
57 |
58 | <%@ include file="common/footer.jsp"%> 59 |
60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | --> 71 | 72 | --> 73 | 74 | 75 | --> 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/welcome/welcome.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ include file="../common/commonInclude.jsp"%> 4 | 5 | 6 | 7 | 8 | 9 | REST API 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
OAuth 2.0 / 使用說明
28 |
29 | 30 |
31 | 32 |
33 |
34 |

OAuth 2.0 是什么?

35 |

OAuth 2.0是在2006年底创建的下一代OAuth协议。OAuth 2.0为客户端开发者开发Web应用,桌面端应用程序,移动应用及客厅设备提供特定的授权流程。该规范是IETF OAuth WG工作组下基于OAuth WRAP协议制定的。

36 |
37 |
38 | 39 |
40 |

OAuth 2.0 能做什么?

41 |

OAuth 2.0 授权框架允许第三方应用通过代表拥有编排批准交互的资源所有者和HTTP服务的资源或者通过允许第三方应用程序获得代表自己访问受限的HTTP服务。

42 |
43 |
44 |
45 |

OAuth 2.0有哪些角色?

46 |

资源拥有者(resource owner):能够授权访问被保护资源的一个实体。当它指的一个人时,就是称之为终端用户。

47 |

资源服务器(resource server):管理受保护资源的服务器。当使用访问令牌访问资源时,它决定是否接受该令牌并输出受保护的资源。

48 |

客户端(client):应用程序本身不存储任何受保护的资源,而是资源所有者授权通过后,使用它的授权访问受保护的资源,然后客户端把响应的数据展示/提交给服务器。

49 |

授权服务器(authorization server):客户端成功验证资源所有者并获取授权后,授权服务器发放访问令牌给客户端。

50 |
51 |
52 |
53 |

OAuth 2.0授权流程?

54 |

1 客户端向资源拥有者发起授权请求,这种授权请求可以直接向资源拥有者发起(如图),也可以间接通过授权服务器作为中介发起。

55 |

2 客户端接收授权许可,这是一个代表资源所有者的授权凭证。授权类型可以OAuth 2.0规范中四种的任意一种,也可以是扩展授权类型。授权类型取决于方法所使用的客户端请求授权和授权服务器所支持的类型。

56 |

3 客户端通过私有证书和授权许可请求授权服务器授权。

57 |

4 授权服务器对客户端进行验证。验证通过后,返回访问令牌。

58 |

5 客户端使用访问令牌向资源服务器请求受保护资源。

59 |

6 资源服务器验证令牌的有效性,验证成功后,下发受保护的资源。

60 | 61 |
62 |
63 | 64 |
65 |
66 | 67 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/controller/server/AuthUserController.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.controller.server; 2 | 3 | import java.util.Map; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | import org.apache.oltu.oauth2.common.OAuth; 9 | import org.apache.oltu.oauth2.common.error.OAuthError; 10 | import org.apache.oltu.oauth2.common.exception.OAuthProblemException; 11 | import org.apache.oltu.oauth2.common.exception.OAuthSystemException; 12 | import org.apache.oltu.oauth2.common.message.OAuthResponse; 13 | import org.apache.oltu.oauth2.common.message.types.ParameterStyle; 14 | import org.apache.oltu.oauth2.common.utils.OAuthUtils; 15 | import org.apache.oltu.oauth2.rs.request.OAuthAccessResourceRequest; 16 | import org.apache.oltu.oauth2.rs.response.OAuthRSResponse; 17 | import org.springframework.beans.factory.annotation.Autowired; 18 | import org.springframework.http.HttpEntity; 19 | import org.springframework.http.HttpHeaders; 20 | import org.springframework.http.HttpStatus; 21 | import org.springframework.http.ResponseEntity; 22 | import org.springframework.stereotype.Controller; 23 | import org.springframework.web.bind.annotation.RequestMapping; 24 | 25 | import com.alibaba.fastjson.JSON; 26 | import com.favccxx.favauth.service.IAuthUserService; 27 | import com.favccxx.favauth.service.IAuthVerifyService; 28 | 29 | @Controller 30 | @RequestMapping("/server") 31 | public class AuthUserController { 32 | 33 | @Autowired 34 | IAuthUserService authUserService; 35 | @Autowired 36 | IAuthVerifyService authVerifyService; 37 | 38 | @SuppressWarnings({ "rawtypes", "unchecked" }) 39 | @RequestMapping(value="/authUserInfo", produces = "text/html;charset=UTF-8") 40 | public HttpEntity authUserInfo(HttpServletRequest request) throws OAuthSystemException { 41 | try { 42 | // 构建OAuth资源请求 43 | OAuthAccessResourceRequest oauthRequest = new OAuthAccessResourceRequest(request, ParameterStyle.QUERY); 44 | String accessToken = oauthRequest.getAccessToken(); 45 | 46 | Object resp = JSON.parse(accessToken); 47 | Map map = (Map)resp; 48 | String accessTokenKey = ""; 49 | if(map.containsKey(OAuth.OAUTH_ACCESS_TOKEN)) { 50 | accessTokenKey = (String)map.get(OAuth.OAUTH_ACCESS_TOKEN); 51 | } 52 | 53 | // 验证访问令牌 54 | if (!authVerifyService.checkAccessToken(accessTokenKey)) { 55 | // 如果不存在/过期了,返回未验证错误,需重新验证 56 | OAuthResponse oauthResponse = OAuthRSResponse.errorResponse(HttpServletResponse.SC_UNAUTHORIZED) 57 | .setRealm("Apache Oltu").setError(OAuthError.ResourceResponse.INVALID_TOKEN) 58 | .buildHeaderMessage(); 59 | 60 | HttpHeaders headers = new HttpHeaders(); 61 | headers.add(OAuth.HeaderType.WWW_AUTHENTICATE, 62 | oauthResponse.getHeader(OAuth.HeaderType.WWW_AUTHENTICATE)); 63 | return new ResponseEntity(headers, HttpStatus.UNAUTHORIZED); 64 | } 65 | 66 | // 返回用户名 67 | 68 | 69 | 70 | String username = authVerifyService.getUsernameByAccessToken(accessTokenKey); 71 | return new ResponseEntity(username, HttpStatus.OK); 72 | } catch (OAuthProblemException e) { 73 | e.printStackTrace(); 74 | 75 | // 检查是否设置了错误码 76 | String errorCode = e.getError(); 77 | if (OAuthUtils.isEmpty(errorCode)) { 78 | OAuthResponse oauthResponse = OAuthRSResponse.errorResponse(HttpServletResponse.SC_UNAUTHORIZED) 79 | .buildHeaderMessage(); 80 | 81 | HttpHeaders headers = new HttpHeaders(); 82 | headers.add(OAuth.HeaderType.WWW_AUTHENTICATE, 83 | oauthResponse.getHeader(OAuth.HeaderType.WWW_AUTHENTICATE)); 84 | 85 | return new ResponseEntity(headers, HttpStatus.UNAUTHORIZED); 86 | } 87 | 88 | OAuthResponse oauthResponse = OAuthRSResponse 89 | .errorResponse(HttpServletResponse.SC_UNAUTHORIZED) 90 | .setError(e.getError()) 91 | .setErrorDescription(e.getDescription()) 92 | .setErrorUri(e.getUri()) 93 | .buildHeaderMessage(); 94 | 95 | HttpHeaders headers = new HttpHeaders(); 96 | headers.add(OAuth.HeaderType.WWW_AUTHENTICATE, 97 | oauthResponse.getHeader(OAuth.HeaderType.WWW_AUTHENTICATE)); 98 | 99 | return new ResponseEntity(HttpStatus.BAD_REQUEST); 100 | } 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/controller/server/AccessTokenController.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.controller.server; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | 6 | import org.apache.oltu.oauth2.as.issuer.MD5Generator; 7 | import org.apache.oltu.oauth2.as.issuer.OAuthIssuerImpl; 8 | import org.apache.oltu.oauth2.as.request.OAuthTokenRequest; 9 | import org.apache.oltu.oauth2.as.response.OAuthASResponse; 10 | import org.apache.oltu.oauth2.common.OAuth; 11 | import org.apache.oltu.oauth2.common.error.OAuthError; 12 | import org.apache.oltu.oauth2.common.exception.OAuthProblemException; 13 | import org.apache.oltu.oauth2.common.exception.OAuthSystemException; 14 | import org.apache.oltu.oauth2.common.message.OAuthResponse; 15 | import org.apache.oltu.oauth2.common.message.types.GrantType; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.http.HttpEntity; 18 | import org.springframework.http.HttpStatus; 19 | import org.springframework.http.ResponseEntity; 20 | import org.springframework.stereotype.Controller; 21 | import org.springframework.web.bind.annotation.RequestMapping; 22 | import org.springframework.web.bind.annotation.RequestMethod; 23 | 24 | import com.favccxx.favauth.model.AuthClient; 25 | import com.favccxx.favauth.service.IAuthClientService; 26 | import com.favccxx.favauth.service.IAuthVerifyService; 27 | 28 | @Controller 29 | @RequestMapping("/server") 30 | public class AccessTokenController { 31 | 32 | @Autowired 33 | IAuthClientService authClientService; 34 | @Autowired 35 | IAuthVerifyService authVerifyService; 36 | 37 | @SuppressWarnings({ "rawtypes", "unchecked" }) 38 | @RequestMapping(value="applyAccessToken", method= {RequestMethod.POST}) 39 | public HttpEntity applyAccessToken(HttpServletRequest request) throws OAuthSystemException, OAuthProblemException{ 40 | //构建OAuth请求 41 | OAuthTokenRequest tokenRequest = new OAuthTokenRequest(request); 42 | //获取OAuth客户端Id 43 | String clientId = tokenRequest.getClientId(); 44 | //校验客户端Id是否正确 45 | AuthClient authClient = authClientService.findByClientId(clientId); 46 | if(authClient==null) { 47 | OAuthResponse oAuthResponse = OAuthASResponse 48 | .errorResponse(HttpServletResponse.SC_BAD_REQUEST) 49 | .setError(OAuthError.TokenResponse.INVALID_CLIENT) 50 | .setErrorDescription("无效的客户端Id") 51 | .buildJSONMessage(); 52 | return new ResponseEntity(oAuthResponse.getBody(), HttpStatus.valueOf(oAuthResponse.getResponseStatus())); 53 | } 54 | 55 | 56 | //检查客户端安全KEY是否正确 57 | if(!authVerifyService.checkClientSecret(tokenRequest.getClientSecret())){ 58 | OAuthResponse response = OAuthResponse.errorResponse(HttpServletResponse.SC_UNAUTHORIZED) 59 | .setError(OAuthError.TokenResponse.UNAUTHORIZED_CLIENT) 60 | .setErrorDescription("客户端安全KEY认证失败!") 61 | .buildJSONMessage(); 62 | return new ResponseEntity(response.getBody(), HttpStatus.valueOf(response.getResponseStatus())); 63 | } 64 | 65 | 66 | String authCode = tokenRequest.getParam(OAuth.OAUTH_CODE); 67 | //验证类型,有AUTHORIZATION_CODE/PASSWORD/REFRESH_TOKEN/CLIENT_CREDENTIALS 68 | if(tokenRequest.getParam(OAuth.OAUTH_GRANT_TYPE).equals(GrantType.AUTHORIZATION_CODE.toString())){ 69 | if(!authVerifyService.checkAuthCode(authCode)){ 70 | OAuthResponse response = OAuthResponse.errorResponse(HttpServletResponse.SC_BAD_REQUEST) 71 | .setError(OAuthError.TokenResponse.INVALID_GRANT) 72 | .setErrorDescription("错误的授权码") 73 | .buildJSONMessage(); 74 | return new ResponseEntity(response.getBody(), HttpStatus.valueOf(response.getResponseStatus())); 75 | } 76 | } 77 | 78 | //生成访问令牌 79 | OAuthIssuerImpl authIssuerImpl = new OAuthIssuerImpl(new MD5Generator()); 80 | String accessToken = authIssuerImpl.accessToken(); 81 | authVerifyService.addAccessToken(accessToken, authVerifyService.getUsernameByAuthCode(authCode)); 82 | 83 | //生成OAuth响应 84 | OAuthResponse response = OAuthASResponse 85 | .tokenResponse(HttpServletResponse.SC_OK) 86 | .setAccessToken(accessToken) 87 | .setExpiresIn(String.valueOf(authVerifyService.getExpireIn())) 88 | .buildJSONMessage(); 89 | return new ResponseEntity(response.getBody(), HttpStatus.valueOf(response.getResponseStatus())); 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/site/site_apply.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ include file="../common/commonInclude.jsp"%> 4 | 5 | 6 | 7 | 8 | 9 | Amaze UI Admin index Examples 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 46 | 47 | 48 | 49 |
50 |
站点管理 / 应用申请
51 |
52 | 53 |
54 |
55 |
56 |
57 |
58 | 59 |
60 | 61 |
62 | 63 |
64 |
65 |
66 | 67 |
68 | 69 |
70 |
71 | 72 |
73 | 74 |
75 | 82 |
83 |
84 | 85 |
86 | 87 |
88 | 89 |
90 |
91 | 92 |
93 |
94 | 95 |
96 |
97 |
98 |
99 |
100 |
101 | 102 | 103 | -------------------------------------------------------------------------------- /src/main/resources/spring/spring-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | 24 | 25 | ${dataSource.driverClassName} 26 | 27 | 28 | ${dataSource.url} 29 | 30 | 31 | ${dataSource.username} 32 | 33 | 34 | ${dataSource.password} 35 | 36 | 37 | 38 | 39 | ${dataSource.c3p0.max_size} 40 | 41 | 42 | 43 | 44 | ${dataSource.c3p0.min_size} 45 | 46 | 47 | 48 | 49 | ${dataSource.c3p0.max_idle_time} 50 | 51 | 52 | 53 | 54 | ${dataSource.c3p0.max_statements} 55 | 56 | 57 | 58 | 59 | ${dataSource.c3p0.idle_test_period} 60 | 61 | 62 | 63 | 64 | ${dataSource.c3p0.acquire_increment} 65 | 66 | 67 | 68 | 69 | 70 | 72 | 73 | 74 | 75 | com.favccxx.favauth.model 76 | 77 | 78 | 79 | 80 | 81 | org.hibernate.dialect.Oracle10gDialect 82 | 83 | false 84 | true 85 | update 86 | true 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /target/classes/spring/spring-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | 24 | 25 | ${dataSource.driverClassName} 26 | 27 | 28 | ${dataSource.url} 29 | 30 | 31 | ${dataSource.username} 32 | 33 | 34 | ${dataSource.password} 35 | 36 | 37 | 38 | 39 | ${dataSource.c3p0.max_size} 40 | 41 | 42 | 43 | 44 | ${dataSource.c3p0.min_size} 45 | 46 | 47 | 48 | 49 | ${dataSource.c3p0.max_idle_time} 50 | 51 | 52 | 53 | 54 | ${dataSource.c3p0.max_statements} 55 | 56 | 57 | 58 | 59 | ${dataSource.c3p0.idle_test_period} 60 | 61 | 62 | 63 | 64 | ${dataSource.c3p0.acquire_increment} 65 | 66 | 67 | 68 | 69 | 70 | 72 | 73 | 74 | 75 | com.favccxx.favauth.model 76 | 77 | 78 | 79 | 80 | 81 | org.hibernate.dialect.Oracle10gDialect 82 | 83 | false 84 | true 85 | update 86 | true 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /src/main/java/com/favccxx/favauth/controller/server/AuthorizationController.java: -------------------------------------------------------------------------------- 1 | package com.favccxx.favauth.controller.server; 2 | 3 | import java.net.URI; 4 | import java.net.URISyntaxException; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | import org.apache.oltu.oauth2.as.issuer.MD5Generator; 10 | import org.apache.oltu.oauth2.as.issuer.OAuthIssuerImpl; 11 | import org.apache.oltu.oauth2.as.request.OAuthAuthzRequest; 12 | import org.apache.oltu.oauth2.as.response.OAuthASResponse; 13 | import org.apache.oltu.oauth2.common.OAuth; 14 | import org.apache.oltu.oauth2.common.exception.OAuthProblemException; 15 | import org.apache.oltu.oauth2.common.exception.OAuthSystemException; 16 | import org.apache.oltu.oauth2.common.message.OAuthResponse; 17 | import org.apache.oltu.oauth2.common.message.types.ResponseType; 18 | import org.springframework.beans.factory.annotation.Autowired; 19 | import org.springframework.http.HttpHeaders; 20 | import org.springframework.stereotype.Controller; 21 | import org.springframework.web.bind.annotation.RequestMapping; 22 | import org.springframework.web.servlet.ModelAndView; 23 | 24 | import com.favccxx.favauth.constants.OAuth2Constants; 25 | import com.favccxx.favauth.model.AuthClient; 26 | import com.favccxx.favauth.service.IAuthClientService; 27 | import com.favccxx.favauth.service.IAuthVerifyService; 28 | 29 | 30 | 31 | @Controller 32 | @RequestMapping("/server") 33 | public class AuthorizationController { 34 | 35 | @Autowired 36 | IAuthClientService authClientService; 37 | @Autowired 38 | IAuthVerifyService authVerifyService; 39 | 40 | @RequestMapping("applyAuthorize") 41 | public ModelAndView applyAuthorize(HttpServletRequest request) throws OAuthSystemException, OAuthProblemException{ 42 | ModelAndView mav = new ModelAndView(); 43 | // String username, String webKey, String scope, String state,String display 44 | //构建OAuth请求 45 | OAuthAuthzRequest oAuthzRequest = new OAuthAuthzRequest(request); 46 | //获取OAuth客户端Id 47 | String clientId = oAuthzRequest.getClientId(); 48 | //校验客户端Id是否正确 49 | AuthClient authClient = authClientService.findByClientId(clientId); 50 | if(authClient==null) { 51 | // OAuthResponse oAuthResponse = OAuthASResponse 52 | // .errorResponse(HttpServletResponse.SC_BAD_REQUEST) 53 | // .setError(OAuthError.TokenResponse.INVALID_CLIENT) 54 | // .setErrorDescription("无效的客户端Id") 55 | // .buildJSONMessage(); 56 | mav.addObject(OAuth2Constants.OAUTH_AUTHORIZE_FAILED_KEY, "无效的客户端Id"); 57 | mav.setViewName("forward:/server/authorizeFailed"); 58 | return mav; 59 | } 60 | 61 | 62 | 63 | String username = authClient.getClientName(); 64 | 65 | //生成授权码 66 | String authCode = null; 67 | String responseType = oAuthzRequest.getParam(OAuth.OAUTH_RESPONSE_TYPE); 68 | //ResponseType仅支持CODE和TOKEN 69 | if(responseType.equals(ResponseType.CODE.toString())){ 70 | OAuthIssuerImpl oAuthIssuerImpl = new OAuthIssuerImpl(new MD5Generator()); 71 | authCode = oAuthIssuerImpl.authorizationCode(); 72 | authVerifyService.addAuthCode(authCode, username); 73 | } 74 | 75 | //构建OAuth响应 76 | OAuthASResponse.OAuthAuthorizationResponseBuilder builder = OAuthASResponse.authorizationResponse(request, HttpServletResponse.SC_FOUND); 77 | 78 | //设置授权码 79 | builder.setCode(authCode); 80 | 81 | //获取客户端重定向地址 82 | String redirectURI = oAuthzRequest.getParam(OAuth.OAUTH_REDIRECT_URI); 83 | 84 | //构建响应 85 | OAuthResponse response = builder.location(redirectURI).buildBodyMessage(); 86 | //根据OAuthResponse返回ResponseEntity响应 87 | HttpHeaders headers = new HttpHeaders(); 88 | try { 89 | headers.setLocation(new URI(response.getLocationUri())); 90 | } catch (URISyntaxException e) { 91 | e.printStackTrace(); 92 | } 93 | 94 | mav.addObject(OAuth.OAUTH_CLIENT_ID, clientId); 95 | mav.addObject(OAuth.OAUTH_CLIENT_SECRET, authClient.getClientSecret()); 96 | 97 | 98 | 99 | mav.addObject(OAuth.OAUTH_CODE, authCode); 100 | mav.setViewName("redirect:"+redirectURI); 101 | return mav; 102 | } 103 | 104 | @RequestMapping("authorizeFailed") 105 | public ModelAndView authorizeFailed(){ 106 | ModelAndView mav = new ModelAndView(); 107 | mav.setViewName("oauth2/oauth2_authorize_fail"); 108 | return mav; 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/js/polyfill/respond.min.js: -------------------------------------------------------------------------------- 1 | /*! Respond.js v1.4.2: min/max-width media query polyfill 2 | * Copyright 2014 Scott Jehl 3 | * Licensed under MIT 4 | * http://j.mp/respondjs */ 5 | 6 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){v(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},g=function(a){return a.replace(c.regex.minmaxwh,"").match(c.regex.other)};if(c.ajax=f,c.queue=d,c.unsupportedmq=g,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var h,i,j,k=a.document,l=k.documentElement,m=[],n=[],o=[],p={},q=30,r=k.getElementsByTagName("head")[0]||l,s=k.getElementsByTagName("base")[0],t=r.getElementsByTagName("link"),u=function(){var a,b=k.createElement("div"),c=k.body,d=l.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=k.createElement("body"),c.style.background="none"),l.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&l.insertBefore(c,l.firstChild),a=b.offsetWidth,f?l.removeChild(c):c.removeChild(b),l.style.fontSize=d,e&&(c.style.fontSize=e),a=j=parseFloat(a)},v=function(b){var c="clientWidth",d=l[c],e="CSS1Compat"===k.compatMode&&d||k.body[c]||d,f={},g=t[t.length-1],p=(new Date).getTime();if(b&&h&&q>p-h)return a.clearTimeout(i),i=a.setTimeout(v,q),void 0;h=p;for(var s in m)if(m.hasOwnProperty(s)){var w=m[s],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?j||u():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?j||u():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(n[w.rules]))}for(var C in o)o.hasOwnProperty(C)&&o[C]&&o[C].parentNode===r&&r.removeChild(o[C]);o.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=k.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,r.insertBefore(E,g.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(k.createTextNode(F)),o.push(E)}},w=function(a,b,d){var e=a.replace(c.regex.comments,"").replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},i=!f&&d;b.length&&(b+="/"),i&&(f=1);for(var j=0;f>j;j++){var k,l,o,p;i?(k=d,n.push(h(a))):(k=e[j].match(c.regex.findStyles)&&RegExp.$1,n.push(RegExp.$2&&h(RegExp.$2))),o=k.split(","),p=o.length;for(var q=0;p>q;q++)l=o[q],g(l)||m.push({media:l.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:n.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}v()},x=function(){if(d.length){var b=d.shift();f(b.href,function(c){w(c,b.href,b.media),p[b.href]=!0,a.setTimeout(function(){x()},0)})}},y=function(){for(var b=0;b param) { 25 | 26 | // 创建Httpclient对象 27 | CloseableHttpClient httpclient = HttpClients.createDefault(); 28 | 29 | String resultString = ""; 30 | CloseableHttpResponse response = null; 31 | try { 32 | // 创建uri 33 | URIBuilder builder = new URIBuilder(url); 34 | if (param != null) { 35 | for (String key : param.keySet()) { 36 | builder.addParameter(key, param.get(key)); 37 | } 38 | } 39 | URI uri = builder.build(); 40 | 41 | // 创建http GET请求 42 | HttpGet httpGet = new HttpGet(uri); 43 | 44 | // 执行请求 45 | response = httpclient.execute(httpGet); 46 | // 判断返回状态是否为200 47 | if (response.getStatusLine().getStatusCode() == 200) { 48 | resultString = EntityUtils.toString(response.getEntity(), "UTF-8"); 49 | } 50 | } catch (Exception e) { 51 | e.printStackTrace(); 52 | } finally { 53 | try { 54 | if (response != null) { 55 | response.close(); 56 | } 57 | httpclient.close(); 58 | } catch (IOException e) { 59 | e.printStackTrace(); 60 | } 61 | } 62 | return resultString; 63 | } 64 | 65 | public static String doGet(String url) { 66 | return doGet(url, null); 67 | } 68 | 69 | public static String doPost(String url, Map param) { 70 | // 创建Httpclient对象 71 | CloseableHttpClient httpClient = HttpClients.createDefault(); 72 | CloseableHttpResponse response = null; 73 | String resultString = ""; 74 | try { 75 | // 创建Http Post请求 76 | HttpPost httpPost = new HttpPost(url); 77 | // 创建参数列表 78 | if (param != null) { 79 | List paramList = new ArrayList<>(); 80 | for (String key : param.keySet()) { 81 | paramList.add(new BasicNameValuePair(key, param.get(key))); 82 | } 83 | // 模拟表单 84 | UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList); 85 | httpPost.setEntity(entity); 86 | } 87 | // 执行http请求 88 | response = httpClient.execute(httpPost); 89 | resultString = EntityUtils.toString(response.getEntity(), "utf-8"); 90 | } catch (Exception e) { 91 | e.printStackTrace(); 92 | } finally { 93 | try { 94 | response.close(); 95 | } catch (IOException e) { 96 | // TODO Auto-generated catch block 97 | e.printStackTrace(); 98 | } 99 | } 100 | 101 | return resultString; 102 | } 103 | 104 | public static String doPost(String url) { 105 | return doPost(url, null); 106 | } 107 | 108 | public static String doPostJson(String url, String json) { 109 | // 创建Httpclient对象 110 | CloseableHttpClient httpClient = HttpClients.createDefault(); 111 | CloseableHttpResponse response = null; 112 | String resultString = ""; 113 | try { 114 | // 创建Http Post请求 115 | HttpPost httpPost = new HttpPost(url); 116 | // 创建请求内容 117 | StringEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON); 118 | httpPost.setEntity(entity); 119 | // 执行http请求 120 | response = httpClient.execute(httpPost); 121 | resultString = EntityUtils.toString(response.getEntity(), "utf-8"); 122 | } catch (Exception e) { 123 | e.printStackTrace(); 124 | } finally { 125 | try { 126 | response.close(); 127 | } catch (IOException e) { 128 | // TODO Auto-generated catch block 129 | e.printStackTrace(); 130 | } 131 | } 132 | 133 | return resultString; 134 | } 135 | 136 | } 137 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/client/home_client.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ include file="../common/commonInclude.jsp"%> 4 | 5 | 6 | 7 | 8 | 白富美交友 9 | 10 | <%-- --%> 11 | 12 | 13 | 14 | 15 |
16 |

CoffeeCols

17 |
18 | 27 |
28 |
29 |

Your Spiffy Tag Line Goes Here

30 |
31 |

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut.

32 | lime 33 |
34 | 35 |
36 |
    37 | 38 |
  • 39 |
    40 | 41 |

    Coffee 101

    42 |

    Proin metus odio, ultricies eu pharetra dictum, laoreet id odio. Curabitur in odio augue. Morbi congue auctor interdum. Phasellus sit amet metus justo.

    43 |
    44 |
  • 45 | 46 | 47 |
  • 48 |
    49 | 50 |

    All About Beans

    51 |

    Morbi congue auctor interdum. Proin metus odio, ultricies eu pharetra dictum, laoreet id odio. Curabitur in odio augue. Phasellus sit amet metus justo.

    52 |
    53 |
  • 54 | 55 | 56 |
  • 57 |
    58 | 59 |

    Compatible Foods

    60 |

    Phasellus sit amet metus justo. Proin metus odio, ultricies eu pharetra dictum, laoreet id odio. Curabitur in odio augue. Morbi congue auctor.

    61 |
    62 |
  • 63 | 64 | 65 |
  • 66 |
    67 | 68 |

    Coffee Sizzle

    69 |

    Proin metus odio, ultricies eu pharetra dictum, laoreet id odio. Morbi congue auctor interdum. Curabitur in odio augue. Phasellus sit amet metus justo.

    70 |
    71 |
  • 72 | 73 | 74 |
  • 75 |
    76 | 77 |

    Tools of the Trade

    78 |

    Curabitur in odio augue. Proin metus odio, ultricies eu pharetra dictum, laoreet id odio. Morbi congue auctor interdum. Phasellus sit amet metus justo.

    79 |
    80 |
  • 81 | 82 | 83 |
  • 84 |
    85 | 86 |

    The Art of Making Coffee

    87 |

    Proin metus odio, ultricies eu pharetra dictum, laoreet id odio. Phasellus sit amet metus justo. Curabitur in odio augue. Morbi congue auctor interdum.

    88 |
    89 |
  • 90 | 91 | 92 |
  • 93 |
    94 | 95 |

    Coffee Style

    96 |

    Proin metus odio, ultricies eu pharetra dictum, laoreet id odio. Curabitur in odio augue. Morbi congue auctor interdum. Phasellus sit amet metus justo.

    97 |
    98 |
  • 99 |
100 |
101 | 102 |
103 |
104 |

Left Stuff

105 |

Left aligned text here. Proin metus odio, ultricies eu pharetra dictum, laoreet id odio. Curabitur in odio augue. Morbi congue auctor interdum. Phasellus sit amet metus justo.

106 |

Next line here

107 |
108 | 109 |
110 |

Center Stuff

111 |

Center Text here. Proin metus odio, ultricies eu pharetra dictum, laoreet id odio. Curabitur in odio augue. Morbi congue auctor interdum. Phasellus sit amet metus justo.

112 |

Next line here

113 |
114 | 115 |
116 |

Right Stuff

117 |

© 2010 yoursite.com All rights reserved.

118 |

Center Text here. Proin metus odio, ultricies eu pharetra dictum, laoreet id odio. Curabitur in odio augue. Morbi congue auctor interdum. Phasellus sit amet metus justo.

119 |
120 | 121 |
122 | 123 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/site/site_approval.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ include file="../common/commonInclude.jsp"%> 4 | 5 | 6 | 7 | 8 | 9 | Amaze UI Admin index Examples 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 47 | 48 | 49 | 53 | 54 |
55 | 56 |
57 | 58 |
59 |
站点管理 / 站点审批
60 |
61 | 62 |
63 |
64 |
65 |
66 | 67 | 68 |
69 |
70 |
71 |
72 |
73 | 80 |
81 |
82 |
83 |
84 | 85 | 86 | 87 | 88 |
89 |
90 |
91 | 92 |
93 |
94 |
95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 122 | 123 | 124 | 125 |
网站名称网站URL网站分类网站状态
${appItem.appName }${appItem.appUrl } 112 | 门户 113 | 社交 114 | 视频 115 | 娱乐 116 | 工具 117 | 118 | 未审核 119 | 审核通过 120 | 审核不通过 121 |
126 |
127 | 共 15 条记录 128 |
129 |
    130 |
  • «
  • 131 |
  • 1
  • 132 |
  • 2
  • 133 |
  • 3
  • 134 |
  • 4
  • 135 |
  • 5
  • 136 |
  • »
  • 137 |
138 |
139 |
140 | 141 |
142 |
143 | 144 |
145 |
146 | 147 |
148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/assets/css/admin.css: -------------------------------------------------------------------------------- 1 | /** 2 | * admin.css 3 | */ 4 | 5 | ul { 6 | margin-top: 0; 7 | } 8 | 9 | .admin-icon-yellow { 10 | color: #ffbe40; 11 | } 12 | 13 | .admin-header { 14 | font-size: 1.4rem; 15 | margin-bottom: 0; 16 | } 17 | 18 | .admin-header-list a:hover :after { 19 | content: none; 20 | } 21 | 22 | .admin-main { 23 | background: #f3f3f3; 24 | } 25 | 26 | .admin-menu { 27 | position: fixed; 28 | bottom: 30px; 29 | right: 20px; 30 | } 31 | 32 | .admin-sidebar { 33 | width: 260px; 34 | min-height: 100%; 35 | float: left; 36 | border-right: 1px solid #cecece; 37 | } 38 | 39 | .admin-sidebar-list { 40 | margin-bottom: 0; 41 | } 42 | 43 | .admin-sidebar-list li a { 44 | color: #5c5c5c; 45 | padding-left: 24px; 46 | } 47 | 48 | .admin-sidebar-list li:first-child { 49 | border-top: none; 50 | } 51 | 52 | .admin-sidebar-sub { 53 | margin-top: 0; 54 | margin-bottom: 0; 55 | box-shadow: 0 16px 8px -15px #e2e2e2 inset; 56 | background: #ececec; 57 | padding-left: 24px; 58 | } 59 | 60 | .admin-sidebar-sub li:first-child { 61 | border-top: 1px solid #dedede; 62 | } 63 | 64 | .admin-sidebar-panel { 65 | margin: 10px; 66 | } 67 | 68 | .admin-content { 69 | width: auto; 70 | overflow: hidden; 71 | height: 100%; 72 | background: #fff; 73 | } 74 | 75 | .admin-content-list { 76 | border: 1px solid #e9ecf1; 77 | margin-top: 0; 78 | } 79 | 80 | .admin-content-list li { 81 | border: 1px solid #e9ecf1; 82 | border-width: 0 1px; 83 | margin-left: -1px; 84 | } 85 | 86 | .admin-content-list li:first-child { 87 | border-left: none; 88 | } 89 | 90 | .admin-content-list li:last-child { 91 | border-right: none; 92 | } 93 | 94 | .admin-content-table a { 95 | color: #535353; 96 | } 97 | .admin-content-file { 98 | margin-bottom: 0; 99 | color: #666; 100 | } 101 | 102 | .admin-content-file p { 103 | margin: 0 0 5px 0; 104 | font-size: 1.4rem; 105 | } 106 | 107 | .admin-content-file li { 108 | padding: 10px 0; 109 | } 110 | 111 | .admin-content-file li:first-child { 112 | border-top: none; 113 | } 114 | 115 | .admin-content-file li:last-child { 116 | border-bottom: none; 117 | } 118 | 119 | .admin-content-file li .am-progress { 120 | margin-bottom: 4px; 121 | } 122 | 123 | .admin-content-file li .am-progress-bar { 124 | line-height: 14px; 125 | } 126 | 127 | .admin-content-task { 128 | margin-bottom: 0; 129 | } 130 | 131 | .admin-content-task li { 132 | padding: 5px 0; 133 | border-color: #eee; 134 | } 135 | 136 | .admin-content-task li:first-child { 137 | border-top: none; 138 | } 139 | 140 | .admin-content-task li:last-child { 141 | border-bottom: none; 142 | } 143 | 144 | .admin-task-meta { 145 | font-size: 1.2rem; 146 | color: #999; 147 | } 148 | 149 | .admin-task-bd { 150 | font-size: 1.4rem; 151 | margin-bottom: 5px; 152 | } 153 | 154 | .admin-content-comment { 155 | margin-bottom: 0; 156 | } 157 | 158 | .admin-content-comment .am-comment-bd { 159 | font-size: 1.4rem; 160 | } 161 | 162 | .admin-content-pagination { 163 | margin-bottom: 0; 164 | } 165 | .admin-content-pagination li a { 166 | padding: 4px 8px; 167 | } 168 | 169 | @media only screen and (min-width: 641px) { 170 | .admin-sidebar { 171 | display: block; 172 | position: static; 173 | background: none; 174 | } 175 | 176 | .admin-offcanvas-bar { 177 | position: static; 178 | width: auto; 179 | background: none; 180 | -webkit-transform: translate3d(0, 0, 0); 181 | -ms-transform: translate3d(0, 0, 0); 182 | transform: translate3d(0, 0, 0); 183 | } 184 | .admin-offcanvas-bar:after { 185 | content: none; 186 | } 187 | } 188 | 189 | @media only screen and (max-width: 640px) { 190 | .admin-sidebar { 191 | width: inherit; 192 | } 193 | 194 | .admin-offcanvas-bar { 195 | background: #f3f3f3; 196 | } 197 | 198 | .admin-offcanvas-bar:after { 199 | background: #BABABA; 200 | } 201 | 202 | .admin-sidebar-list a:hover, .admin-sidebar-list a:active{ 203 | -webkit-transition: background-color .3s ease; 204 | -moz-transition: background-color .3s ease; 205 | -ms-transition: background-color .3s ease; 206 | -o-transition: background-color .3s ease; 207 | transition: background-color .3s ease; 208 | background: #E4E4E4; 209 | } 210 | 211 | .admin-content-list li { 212 | padding: 10px; 213 | border-width: 1px 0; 214 | margin-top: -1px; 215 | } 216 | 217 | .admin-content-list li:first-child { 218 | border-top: none; 219 | } 220 | 221 | .admin-content-list li:last-child { 222 | border-bottom: none; 223 | } 224 | 225 | .admin-form-text { 226 | text-align: left !important; 227 | } 228 | 229 | } 230 | 231 | /* 232 | * user.html css 233 | */ 234 | .user-info { 235 | margin-bottom: 15px; 236 | } 237 | 238 | .user-info .am-progress { 239 | margin-bottom: 4px; 240 | } 241 | 242 | .user-info p { 243 | margin: 5px; 244 | } 245 | 246 | .user-info-order { 247 | font-size: 1.4rem; 248 | } 249 | 250 | /* 251 | * errorLog.html css 252 | */ 253 | 254 | .error-log .am-pre-scrollable { 255 | max-height: 40rem; 256 | } 257 | 258 | /* 259 | * table.html css 260 | */ 261 | 262 | .table-main { 263 | font-size: 1.4rem; 264 | padding: .5rem; 265 | } 266 | 267 | .table-main button { 268 | background: #fff; 269 | } 270 | 271 | .table-check { 272 | width: 30px; 273 | } 274 | 275 | .table-id { 276 | width: 50px; 277 | } 278 | 279 | @media only screen and (max-width: 640px) { 280 | .table-select { 281 | margin-top: 10px; 282 | margin-left: 5px; 283 | } 284 | } 285 | 286 | /* 287 | gallery.html css 288 | */ 289 | 290 | .gallery-list li { 291 | padding: 10px; 292 | } 293 | 294 | .gallery-list a { 295 | color: #666; 296 | } 297 | 298 | .gallery-list a:hover { 299 | color: #3bb4f2; 300 | } 301 | 302 | .gallery-title { 303 | margin-top: 6px; 304 | font-size: 1.4rem; 305 | } 306 | 307 | .gallery-desc { 308 | font-size: 1.2rem; 309 | margin-top: 4px; 310 | } 311 | 312 | /* 313 | 404.html css 314 | */ 315 | 316 | .page-404 { 317 | background: #fff; 318 | border: none; 319 | width: 200px; 320 | margin: 0 auto; 321 | } 322 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/oauth2/oauth2_login_app.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ include file="../common/commonInclude.jsp"%> 4 | 5 | 6 | 7 | 8 | 9 | Amaze UI Admin index Examples 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 43 | 44 | 45 | 49 | 50 |
51 | 52 |
53 | 54 |
55 |
站点管理 / 站点审批
56 |
57 | 58 |
59 |
60 |
61 |
62 | 63 | 64 | 65 | 66 |
67 |
68 |
69 |
70 |
71 | 78 |
79 |
80 |
81 |
82 | 83 | 84 | 85 | 86 |
87 |
88 |
89 | 90 |
91 |
92 |
93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 120 | 121 | 122 | 123 |
网站名称网站URL网站分类网站状态
${appItem.appName }${appItem.appUrl } 110 | 门户 111 | 社交 112 | 视频 113 | 娱乐 114 | 工具 115 | 116 | 未审核 117 | 审核通过 118 | 审核不通过 119 |
124 |
125 | 共 15 条记录 126 |
127 |
    128 |
  • «
  • 129 |
  • 1
  • 130 |
  • 2
  • 131 |
  • 3
  • 132 |
  • 4
  • 133 |
  • 5
  • 134 |
  • »
  • 135 |
136 |
137 |
138 | 139 |
140 |
141 | 142 |
143 |
144 | 145 |
146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/admin-404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Amaze UI Admin 404 Examples 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 23 | 24 |
25 |
26 | Amaze UI 后台管理模板 27 |
28 | 29 | 30 | 31 |
32 | 33 | 47 |
48 |
49 | 50 |
51 | 52 |
53 |
54 | 70 | 71 |
72 |
73 |

公告

74 |

时光静好,与君语;细水流年,与君同。—— Amaze UI

75 |
76 |
77 | 78 |
79 |
80 |

wiki

81 |

Welcome to the Amaze UI wiki!

82 |
83 |
84 |
85 |
86 | 87 | 88 | 89 |
90 | 91 |
92 |
404 / That’s an error
93 |
94 | 95 |
96 |
97 |

404. Not Found

98 |

没有找到你要的页面

99 |
100 |           .----.
101 |        _.'__    `.
102 |    .--($)($$)---/#\
103 |  .' @          /###\
104 |  :         ,   #####
105 |   `-..__.-' _.-\###/
106 |         `;_:    `"'
107 |       .'"""""`.
108 |      /,  ya ,\\
109 |     //  404!  \\
110 |     `-._______.-'
111 |     ___`. | .'___
112 |    (______|______)
113 |         
114 |
115 |
116 |
117 | 118 | 119 |
120 | 121 | 122 | 123 |
124 |
125 |

© 2014 AllMobilize, Inc. Licensed under MIT license.

126 |
127 | 128 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/site/site_authorize.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ include file="../common/commonInclude.jsp"%> 4 | 5 | 6 | 7 | 8 | 9 | Amaze UI Admin index Examples 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 47 | 48 | 49 | 53 | 54 |
55 | 56 |
57 | 58 |
59 |
站点管理 / 站点审批
60 |
61 | 62 |
63 |
64 |
65 |
66 | 67 | 68 |
69 |
70 |
71 |
72 |
73 | 80 |
81 |
82 |
83 |
84 | 85 | 86 | 87 | 88 |
89 |
90 |
91 | 92 |
93 |
94 |
95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 122 | 123 | 124 | 125 |
网站名称网站URL网站分类网站状态
${webSiteItem.webName }${webSiteItem.webUrl } 112 | 门户 113 | 社交 114 | 视频 115 | 娱乐 116 | 工具 117 | 118 | 未审核 119 | 审核通过 120 | 审核不通过 121 |
126 |
127 | 共 15 条记录 128 |
129 |
    130 |
  • «
  • 131 |
  • 1
  • 132 |
  • 2
  • 133 |
  • 3
  • 134 |
  • 4
  • 135 |
  • 5
  • 136 |
  • »
  • 137 |
138 |
139 |
140 | 141 |
142 |
143 | 144 |
145 |
146 | 147 |
148 | 149 | 150 | 151 | 158 | 159 | 160 | <%-- --%> 161 | <%-- --%> 162 | 163 | <%-- --%> 164 | 165 | -------------------------------------------------------------------------------- /src/main/webapp/assets/css/home_client.css: -------------------------------------------------------------------------------- 1 | /* Created by http://freehtml5templates.com */ 2 | /* basics */ 3 | 4 | /* reset */ 5 | * { 6 | margin: 0; 7 | padding: 0; 8 | } 9 | 10 | /* render html5 elements as block */ 11 | header, footer, section, aside, nav, article { 12 | display: block; 13 | } 14 | 15 | /* standard body */ 16 | body { 17 | margin: 0 auto; 18 | width: 960px; 19 | font: 14px/20px "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif; 20 | background: #271408 url("images/bodybkg.gif") repeat; 21 | } 22 | 23 | /* standard alignments */ 24 | .alignleft { 25 | float: left; 26 | } 27 | 28 | img.alignleft { 29 | margin: 5px 10px 0 0; 30 | } 31 | 32 | .alignright { 33 | float: right; 34 | } 35 | 36 | img.alignright { 37 | margin: 5px 0 0 10px; 38 | } 39 | 40 | .center { 41 | text-align: center; 42 | } 43 | 44 | .fleft { 45 | text-align: left; 46 | float: left; 47 | margin-left: 20px; 48 | } 49 | 50 | .fright { 51 | float: right; 52 | text-align: right; 53 | margin-right: 20px; 54 | } 55 | 56 | .fcentered { 57 | text-align: center; 58 | } 59 | 60 | /* Hx tags */ 61 | 62 | h1 { 63 | font-size: 48px; 64 | padding: 20px 0; 65 | text-shadow: 2px 2px 2px #000; 66 | color: #d6a965; 67 | } 68 | 69 | h2 { 70 | font-size: 24px; 71 | padding: 20px 0; 72 | } 73 | 74 | h3 { 75 | font-size: 18px; 76 | padding: 10px 0; 77 | } 78 | 79 | p { 80 | padding-bottom: 20px; 81 | } 82 | 83 | /* nav */ 84 | 85 | nav { 86 | position: absolute; 87 | width: 960px; 88 | background: url("assets/images/navbg.png"); 89 | 90 | /* curved border radius */ 91 | -moz-border-radius: 10px; 92 | -webkit-border-radius: 10px; 93 | } 94 | 95 | nav ul { 96 | margin: 0 auto; 97 | width: 960px; 98 | list-style: none; 99 | } 100 | 101 | nav ul li { 102 | float: left; 103 | } 104 | 105 | nav ul li a { 106 | display: block; 107 | margin-right: 20px; 108 | width: 140px; 109 | font-size: 16px; 110 | font-weight: bold; 111 | line-height: 44px; 112 | text-align: center; 113 | text-decoration: none; 114 | color: #f2ede7; 115 | } 116 | 117 | nav ul li a:hover { 118 | color: #d6a965; 119 | } 120 | 121 | nav ul li.selected a { 122 | color: #d6a965; 123 | } 124 | 125 | nav ul li.subscribe a { 126 | margin-left: 20px; 127 | padding-left: 33px; 128 | text-align: left; 129 | background: url("assets/images/rss.png") left center no-repeat; 130 | } 131 | 132 | 133 | 134 | /* intro */ 135 | 136 | #intro { 137 | position: relative; 138 | margin-top: 55px; 139 | padding: 50px; 140 | background: #695e53 url("assets/images/introbkg.png") repeat-x; 141 | 142 | /* background size */ 143 | -webkit-background-size: 100%; 144 | -o-background-size: 100%; 145 | -khtml-background-size: 100%; 146 | 147 | 148 | /* curved border radius */ 149 | -moz-border-radius: 10px; 150 | -webkit-border-radius: 10px; 151 | } 152 | 153 | #intro h2, #intro p { 154 | position: relative; 155 | z-index: 9999; 156 | width: 350px; 157 | } 158 | 159 | #intro h2 { 160 | padding: 0 0 20px 0; 161 | font-weight: normal; 162 | color: #fff; 163 | } 164 | 165 | #intro p { 166 | padding: 0; 167 | color: #d6a965; 168 | } 169 | 170 | #intro img { 171 | position: absolute; 172 | top: 0; 173 | right: 0; 174 | width: 653px; 175 | height: 100%; 176 | 177 | /* curved border radius */ 178 | -moz-border-radius: 10px; 179 | -webkit-border-radius: 10px; 180 | } 181 | 182 | /* content and sidebar layout */ 183 | 184 | #content { 185 | position: relative; 186 | margin-top: 50px; 187 | float: left; 188 | width: 920px; 189 | margin:10px 5px 10px 0; 190 | padding:5px 20px 5px 20px; 191 | background-color: #f2ede7; 192 | 193 | /* curved border radius */ 194 | -moz-border-radius: 10px; 195 | -webkit-border-radius: 10px; 196 | } 197 | 198 | /* columns */ 199 | 200 | #content ul.column { 201 | width: 100%; 202 | padding: 0; 203 | margin: 10px 0; 204 | list-style: none; 205 | } 206 | 207 | #content ul.column li { 208 | float: left; 209 | width: 230px; /*Set default width*/ 210 | padding: 0; 211 | margin: 5px 0; 212 | display: inline; 213 | } 214 | 215 | #content .block { 216 | height: 355px; 217 | font-size: 1em; 218 | margin-right: 10px; /*Creates the 10px gap between each column*/ 219 | padding: 20px; 220 | background: #d6a965; 221 | /* curved border radius */ 222 | -moz-border-radius: 10px; 223 | -webkit-border-radius: 10px; 224 | } 225 | 226 | #content .block a { 227 | color: #FFF; 228 | } 229 | 230 | #content .block img { 231 | /*Flexible image size with border*/ 232 | width: 89%; /*Took 1% off of the width to prevent IE6 bug*/ 233 | padding: 5%; 234 | background:#fff; 235 | margin: 0 auto; 236 | display: block; 237 | -ms-interpolation-mode: bicubic; /*prevents image pixelation IE 6/7 */ 238 | } 239 | /* end of column configuration */ 240 | 241 | /* footer */ 242 | footer { 243 | width: 960px; 244 | clear: both; 245 | color: #f2ede7; 246 | overflow: hidden; 247 | padding-top: 10px; 248 | background-color: #271408; 249 | /* curved border radius */ 250 | -moz-border-radius: 10px; 251 | -webkit-border-radius: 10px; 252 | height: 200px; 253 | margin-bottom: 10px; 254 | } 255 | 256 | footer section { 257 | width: 300px; 258 | float: left; 259 | padding: 0 10px; 260 | } 261 | 262 | footer section h2 { 263 | margin-top: 0; 264 | } 265 | 266 | footer section p { 267 | font-size: 12px; 268 | } 269 | 270 | footer section a { 271 | color: #999; 272 | } 273 | 274 | footer section a:hover { 275 | color: #FFF; 276 | text-decoration: none; 277 | } 278 | 279 | /* for inner pages */ 280 | 281 | /* content and sidebar layout */ 282 | 283 | #innercontent { 284 | float: left; 285 | width: 610px; 286 | margin:10px 5px 10px 0; 287 | padding:5px 20px 5px 20px; 288 | background-color: #d6a965; 289 | 290 | /* curved border radius */ 291 | -moz-border-radius: 10px; 292 | -webkit-border-radius: 10px; 293 | } 294 | 295 | aside { 296 | float: right; 297 | text-align: left; 298 | width: 300px; 299 | margin:0; 300 | padding:0; 301 | } 302 | 303 | /* article */ 304 | .articlecontent header p, .blogPost header p a { 305 | font-size: 14px; 306 | font-style: italic; 307 | color: #777; 308 | } 309 | 310 | .articlecontent p a { 311 | color: #695e53; 312 | } 313 | 314 | .articlecontent p a:hover { 315 | color: #fff; 316 | } 317 | 318 | .articlecontent header p a:hover { 319 | text-decoration: none; 320 | color: #000; 321 | } 322 | 323 | /* box shadow on pics */ 324 | .articlecontent img { 325 | -webkit-box-shadow: 3px 3px 7px #777; 326 | } 327 | 328 | /* sidebar */ 329 | aside section { 330 | margin: 10px 0 0 10px; 331 | padding: 10px 15px; 332 | background-color: #d6a965; 333 | 334 | /* curved border radius */ 335 | -moz-border-radius: 10px; 336 | -webkit-border-radius: 10px; 337 | } 338 | 339 | aside section ul { 340 | margin: 0 0 0 20px; 341 | color: #FFF; 342 | } 343 | 344 | aside section ul li a { 345 | display: block; 346 | text-decoration: none; 347 | color: #695e53; 348 | } 349 | 350 | aside section ul li a:hover { 351 | text-decoration: underline; 352 | color: #fff; 353 | } 354 | 355 | 356 | -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/admin-help.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Amaze UI Admin help Examples 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 23 | 24 |
25 |
26 | Amaze UI 后台管理模板 27 |
28 | 29 | 30 | 31 |
32 | 33 | 47 |
48 |
49 | 50 |
51 | 52 |
53 |
54 | 70 | 71 |
72 |
73 |

公告

74 |

时光静好,与君语;细水流年,与君同。—— Amaze UI

75 |
76 |
77 | 78 |
79 |
80 |

wiki

81 |

Welcome to the Amaze UI wiki!

82 |
83 |
84 |
85 |
86 | 87 | 88 | 89 |
90 |
91 |
帮助页面 / Help Page
92 |
93 | 94 |
95 | 96 |
97 |
98 |

Amaze UI 1.0.0 Beta

99 |

对于 Amaze UI,我们不是创造者。

100 |

Amaze UI 的诞生,依托于 GitHub 及其他技术社区上一些优秀的资源;Amaze UI 的成长,则离不开用户的支持。

101 |

感谢开源!感谢有你!

102 |
103 |
104 | 105 |
106 |

Bug 反馈

107 |

感谢对 Amaze UI 的关注和支持,如遇到 Bug 或者使用问题,可以通过以下途径反馈给我们:

108 |
    109 |
  1. 在 GitHub 项目主页提交 Issue
  2. 110 |
  3. 在 GitHub 项目主页提交 Issue
  4. 111 |
112 |

反馈注意事项

113 |

为了能最准确的传达所描述的问题, 建议你在反馈时附上演示,方便我们理解。

114 |

下面的几个链接是我们在几个在线调试工具上建的页面, 已经引入了 Amaze UI 样式和脚本,你可以选择你喜欢的工具【Fork】一份, 把要有问题的场景粘在里面,反馈给我们。

115 |
    116 |
  1. JSBin
  2. 117 |
  3. JSFiddle
  4. 118 |
  5. CodePen
  6. 119 |
120 |
121 |
122 |
123 | 124 | 125 |
126 | 127 | 128 | 129 |
130 |
131 |

© 2014 AllMobilize, Inc. Licensed under MIT license.

132 |
133 | 134 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/oauth2/oauth2_login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ include file="../common/commonInclude.jsp"%> 4 | 5 | 6 | 7 | 8 | 9 | OAuth 2.0登陆 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 32 | 33 | 56 | 57 | 58 | 59 |
60 |
61 |
62 |

微博

63 | 64 |
65 | 66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | app 74 |
75 |
76 |

白富美

77 |
78 |
79 |
80 |
81 |
82 | http://app.weibo.com/t/feed/KfQVs
有 12 个你关注的人连接 83 |
84 |
85 |
    86 |
  • 87 |
  • 88 |
  • 89 |
90 |
91 |
92 |
93 |
94 |
95 |
将允许白富美进行以下操作:
96 |
    97 |
  • 98 | 获得你的个人信息,好友关系 99 |
  • 100 |
  • 101 | 分享内容到你的微博 102 |
  • 103 |
  • 104 | 获得你的评论 105 |
  • 106 |
107 |
108 |
109 |
110 | 隐私设置: 111 | 112 | 所有人可见 113 | 114 | 115 | 116 | 117 |
118 |
119 | 为了模拟方便,设置所有人都可以看到你在 白富美 上的动态 120 |
121 |
122 |
123 |
124 | 125 | 143 |
144 |
145 |
146 | 147 |

提示:为保障帐号安全,请认准本页URL地址必须以 api.weibo.com 开头

148 | 149 |
150 |
151 | 152 | -------------------------------------------------------------------------------- /src/main/webapp/AmazeUI-2.1.0/iscroll.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 豆瓣同城 - 音乐 - 北京 | Just a iScroll Demo 8 | 9 | 55 | 56 | 57 |
58 |
59 |

60 | 同城 - 音乐 61 |

62 |
63 | 64 |
66 |
67 |
68 | 下拉刷新 70 | 71 |
72 |
    73 |
  • 74 |
    75 | 正在加载内容... 76 |
    77 |
  • 78 |
79 |
80 | 上拉加载更多 82 | 83 |
84 |
85 |
86 |
87 | 88 | 89 | 98 | 99 | 240 | 241 | 242 | 243 | -------------------------------------------------------------------------------- /target/m2e-wtp/web-resources/META-INF/maven/com.favccxx.favauth/FavOAuth2/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | com.favccxx.favauth 5 | FavOAuth2 6 | war 7 | 0.0.1-SNAPSHOT 8 | FavOAuth2 Maven Webapp 9 | http://maven.apache.org 10 | 11 | 4.3.16.RELEASE 12 | 5.2.11.Final 13 | 5.4.1.Final 14 | 0.9.5.2 15 | 5.1.34 16 | 1.0.2 17 | 2.7.8 18 | 4.4 19 | 1.2.1 20 | 1.1.2 21 | 3.1.0 22 | 2.3.1 23 | 1.2.38 24 | 2.8.2 25 | 26 | 27 | 28 | 29 | 30 | org.apache.oltu.oauth2 31 | org.apache.oltu.oauth2.common 32 | ${oltu.version} 33 | 34 | 35 | org.apache.oltu.oauth2 36 | org.apache.oltu.oauth2.authzserver 37 | ${oltu.version} 38 | 39 | 40 | org.apache.oltu.oauth2 41 | org.apache.oltu.oauth2.client 42 | ${oltu.version} 43 | 44 | 45 | org.apache.oltu.oauth2 46 | org.apache.oltu.oauth2.resourceserver 47 | ${oltu.version} 48 | 49 | 50 | 51 | org.springframework 52 | spring-core 53 | ${spring.version} 54 | 55 | 56 | org.springframework 57 | spring-webmvc 58 | ${spring.version} 59 | 60 | 61 | org.springframework 62 | spring-beans 63 | ${spring.version} 64 | 65 | 66 | org.springframework 67 | spring-context 68 | ${spring.version} 69 | 70 | 71 | org.springframework 72 | spring-context-support 73 | ${spring.version} 74 | 75 | 76 | org.springframework 77 | spring-tx 78 | ${spring.version} 79 | 80 | 81 | org.springframework 82 | spring-oxm 83 | ${spring.version} 84 | 85 | 86 | org.springframework 87 | spring-jdbc 88 | ${spring.version} 89 | 90 | 91 | 92 | org.springframework 93 | spring-orm 94 | ${spring.version} 95 | 96 | 97 | 98 | 99 | org.hibernate 100 | hibernate-core 101 | ${hibernate.version} 102 | 103 | 104 | 105 | 106 | 107 | org.hibernate 108 | hibernate-c3p0 109 | ${hibernate.version} 110 | 111 | 112 | 113 | org.hibernate 114 | hibernate-validator 115 | ${hibernate.validator} 116 | 117 | 118 | 119 | org.apache.commons 120 | commons-lang3 121 | 3.7 122 | 123 | 124 | 125 | com.oracle 126 | ojdbc6 127 | 12.1.0.1-atlassian-hosted 128 | test 129 | 130 | 131 | 132 | com.fasterxml.jackson.core 133 | jackson-core 134 | ${jackson.version} 135 | 136 | 137 | com.fasterxml.jackson.core 138 | jackson-annotations 139 | ${jackson.version} 140 | 141 | 142 | com.fasterxml.jackson.core 143 | jackson-databind 144 | ${jackson.version} 145 | 146 | 147 | 148 | 149 | com.mchange 150 | c3p0 151 | ${c3p0.version} 152 | 153 | 154 | 155 | 156 | javax.servlet.jsp.jstl 157 | javax.servlet.jsp.jstl-api 158 | ${jstl.version} 159 | 160 | 161 | 162 | taglibs 163 | standard 164 | ${tld.version} 165 | 166 | 167 | 168 | 169 | net.sf.ehcache 170 | ehcache 171 | 2.8.3 172 | 173 | 174 | 175 | javax.servlet 176 | javax.servlet-api 177 | ${servlets.version} 178 | provided 179 | 180 | 181 | 182 | 183 | javax.servlet.jsp 184 | javax.servlet.jsp-api 185 | ${jsp.version} 186 | provided 187 | 188 | 189 | 190 | 191 | org.apache.logging.log4j 192 | log4j-core 193 | ${log4j.version} 194 | 195 | 196 | org.apache.logging.log4j 197 | log4j-api 198 | ${log4j.version} 199 | 200 | 201 | 202 | mysql 203 | mysql-connector-java 204 | 6.0.6 205 | 206 | 207 | 208 | org.apache.httpcomponents 209 | httpclient 210 | ${httpclient.version} 211 | 212 | 213 | 214 | com.alibaba 215 | fastjson 216 | 1.2.38 217 | 218 | 219 | 220 | junit 221 | junit 222 | 3.8.1 223 | test 224 | 225 | 226 | 227 | FavOAuth2 228 | 229 | 230 | --------------------------------------------------------------------------------