m-11/6
This commit is contained in:
@@ -9,10 +9,10 @@ import org.maxkey.authz.endpoint.AuthorizeBaseEndpoint;
|
||||
import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
|
||||
import org.maxkey.authz.formbased.endpoint.adapter.FormBasedDefaultAdapter;
|
||||
import org.maxkey.constants.BOOLEAN;
|
||||
import org.maxkey.dao.service.FormBasedDetailsService;
|
||||
import org.maxkey.dao.service.AppsFormBasedDetailsService;
|
||||
import org.maxkey.domain.Accounts;
|
||||
import org.maxkey.domain.apps.Applications;
|
||||
import org.maxkey.domain.apps.FormBasedDetails;
|
||||
import org.maxkey.domain.apps.Apps;
|
||||
import org.maxkey.domain.apps.AppsFormBasedDetails;
|
||||
import org.maxkey.util.Instance;
|
||||
import org.maxkey.web.WebContext;
|
||||
import org.slf4j.Logger;
|
||||
@@ -32,7 +32,7 @@ public class FormBasedAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
final static Logger _logger = LoggerFactory.getLogger(FormBasedAuthorizeEndpoint.class);
|
||||
|
||||
@Autowired
|
||||
FormBasedDetailsService formBasedDetailsService;
|
||||
AppsFormBasedDetailsService formBasedDetailsService;
|
||||
|
||||
FormBasedDefaultAdapter defaultFormBasedAdapter=new FormBasedDefaultAdapter();
|
||||
|
||||
@@ -40,14 +40,14 @@ public class FormBasedAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
public ModelAndView authorize(
|
||||
HttpServletRequest request,
|
||||
@PathVariable("id") String id){
|
||||
FormBasedDetails formBasedDetails=formBasedDetailsService.get(id);
|
||||
AppsFormBasedDetails formBasedDetails=formBasedDetailsService.get(id);
|
||||
_logger.debug(""+formBasedDetails);
|
||||
Applications application= getApplication(id);
|
||||
Apps application= getApp(id);
|
||||
formBasedDetails.setAdapter(application.getAdapter());
|
||||
formBasedDetails.setIsAdapter(application.getIsAdapter());
|
||||
ModelAndView modelAndView=null;
|
||||
|
||||
Accounts appUser=getAppAccounts(formBasedDetails);
|
||||
Accounts appUser=getAccounts(formBasedDetails);
|
||||
|
||||
_logger.debug("Accounts "+appUser);
|
||||
if(appUser == null){
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
|
||||
import org.maxkey.constants.BOOLEAN;
|
||||
import org.maxkey.crypto.DigestUtils;
|
||||
import org.maxkey.domain.UserInfo;
|
||||
import org.maxkey.domain.apps.FormBasedDetails;
|
||||
import org.maxkey.domain.apps.AppsFormBasedDetails;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
public class FormBasedDefaultAdapter extends AbstractAuthorizeAdapter {
|
||||
@@ -23,7 +23,7 @@ public class FormBasedDefaultAdapter extends AbstractAuthorizeAdapter {
|
||||
@Override
|
||||
public ModelAndView authorize(UserInfo userInfo, Object app, String data,ModelAndView modelAndView) {
|
||||
modelAndView.setViewName("authorize/formbased_sso_submint");
|
||||
FormBasedDetails details=(FormBasedDetails)app;
|
||||
AppsFormBasedDetails details=(AppsFormBasedDetails)app;
|
||||
|
||||
modelAndView.addObject("username", details.getAppUser().getRelatedUsername());
|
||||
modelAndView.addObject("password", details.getAppUser().getRelatedPassword());
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.maxkey.authz.formbased.endpoint.adapter;
|
||||
import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
|
||||
import org.maxkey.constants.BOOLEAN;
|
||||
import org.maxkey.domain.UserInfo;
|
||||
import org.maxkey.domain.apps.FormBasedDetails;
|
||||
import org.maxkey.domain.apps.AppsFormBasedDetails;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
public class FormBasedNetease163EmailAdapter extends AbstractAuthorizeAdapter {
|
||||
@@ -22,7 +22,7 @@ public class FormBasedNetease163EmailAdapter extends AbstractAuthorizeAdapter {
|
||||
@Override
|
||||
public ModelAndView authorize(UserInfo userInfo, Object app, String data,ModelAndView modelAndView) {
|
||||
modelAndView.setViewName("authorize/formbased_netease_163email_sso_submint");
|
||||
FormBasedDetails details=(FormBasedDetails)app;
|
||||
AppsFormBasedDetails details=(AppsFormBasedDetails)app;
|
||||
modelAndView.addObject("username", details.getAppUser().getRelatedUsername().substring(details.getAppUser().getRelatedUsername().indexOf("@")));
|
||||
modelAndView.addObject("email", details.getAppUser().getRelatedUsername());
|
||||
modelAndView.addObject("password", details.getAppUser().getRelatedPassword());
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.Date;
|
||||
import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
|
||||
import org.maxkey.crypto.DigestUtils;
|
||||
import org.maxkey.domain.UserInfo;
|
||||
import org.maxkey.domain.apps.FormBasedDetails;
|
||||
import org.maxkey.domain.apps.AppsFormBasedDetails;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
public class FormBasedNeteaseNoteYoudaoAdapter extends AbstractAuthorizeAdapter {
|
||||
@@ -24,7 +24,7 @@ public class FormBasedNeteaseNoteYoudaoAdapter extends AbstractAuthorizeAdapter
|
||||
@Override
|
||||
public ModelAndView authorize(UserInfo userInfo, Object app, String data,ModelAndView modelAndView) {
|
||||
modelAndView.setViewName("authorize/formbased_netease_noteyoudao_sso_submint");
|
||||
FormBasedDetails details=(FormBasedDetails)app;
|
||||
AppsFormBasedDetails details=(AppsFormBasedDetails)app;
|
||||
modelAndView.addObject("username", details.getAppUser().getRelatedUsername());
|
||||
modelAndView.addObject("password", DigestUtils.md5Hex(details.getAppUser().getRelatedPassword()));
|
||||
modelAndView.addObject("currentTime", (new Date()).getTime());
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
|
||||
import org.maxkey.constants.BOOLEAN;
|
||||
import org.maxkey.crypto.DigestUtils;
|
||||
import org.maxkey.domain.UserInfo;
|
||||
import org.maxkey.domain.apps.FormBasedDetails;
|
||||
import org.maxkey.domain.apps.AppsFormBasedDetails;
|
||||
import org.maxkey.web.WebContext;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class FormBasedRedirectAdapter extends AbstractAuthorizeAdapter {
|
||||
@Override
|
||||
public ModelAndView authorize(UserInfo userInfo, Object app, String data,ModelAndView modelAndView) {
|
||||
modelAndView.setViewName("authorize/formbased_redirect_submint");
|
||||
FormBasedDetails details=(FormBasedDetails)app;
|
||||
AppsFormBasedDetails details=(AppsFormBasedDetails)app;
|
||||
|
||||
modelAndView.addObject("id", details.getId());
|
||||
modelAndView.addObject("action", details.getRedirectUri());
|
||||
|
||||
Reference in New Issue
Block a user