gradle build
gradle build
This commit is contained in:
1
maxkey-protocols/maxkey-protocol-authorize/.gitignore
vendored
Normal file
1
maxkey-protocols/maxkey-protocol-authorize/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build/
|
||||
1
maxkey-protocols/maxkey-protocol-authorize/bin/main/.gitignore
vendored
Normal file
1
maxkey-protocols/maxkey-protocol-authorize/bin/main/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/org/
|
||||
@@ -10,7 +10,7 @@ dependencies {
|
||||
compile project(":maxkey-dao")
|
||||
compile project(":maxkey-jose-jwt")
|
||||
compile project(":maxkey-client-sdk")
|
||||
compile project(":maxkey-protocols:maxkey-protocol-oauth-2.0")
|
||||
compile project(":maxkey-protocols:maxkey-protocol-saml-2.0")
|
||||
//compileOnly project(":maxkey-protocols:maxkey-protocol-oauth-2.0")
|
||||
//compileOnly project(":maxkey-protocols:maxkey-protocol-saml-2.0")
|
||||
|
||||
}
|
||||
@@ -5,16 +5,13 @@ package org.maxkey.authz.endpoint;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.maxkey.authz.oauth2.provider.ClientDetailsService;
|
||||
import org.maxkey.client.utils.HttpEncoder;
|
||||
|
||||
import org.maxkey.constants.PROTOCOLS;
|
||||
import org.maxkey.dao.service.AppsCasDetailsService;
|
||||
import org.maxkey.domain.apps.Apps;
|
||||
import org.maxkey.domain.apps.oauth2.provider.ClientDetails;
|
||||
import org.maxkey.web.WebConstants;
|
||||
import org.maxkey.web.WebContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -26,12 +23,6 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
*/
|
||||
@Controller
|
||||
public class AuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
private static final String OAUTH_V20_AUTHORIZATION_URL = "%s/oauth/v20/authorize?client_id=%s&response_type=code&redirect_uri=%s&approval_prompt=auto";
|
||||
|
||||
@Autowired
|
||||
@Qualifier("oauth20JdbcClientDetailsService")
|
||||
private ClientDetailsService clientDetailsService;
|
||||
|
||||
@Autowired
|
||||
AppsCasDetailsService casDetailsService;
|
||||
|
||||
@@ -51,23 +42,13 @@ public class AuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.FORMBASED)){
|
||||
modelAndView=WebContext.forward("/authz/formbased/"+id);
|
||||
}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.OAUTH20)){
|
||||
ClientDetails clientDetails =clientDetailsService.loadClientByClientId(application.getId());
|
||||
_logger.debug(""+clientDetails);
|
||||
String authorizationUrl = String.format(OAUTH_V20_AUTHORIZATION_URL,
|
||||
applicationConfig.getServerPrefix(),
|
||||
clientDetails.getClientId(),
|
||||
HttpEncoder.encode(clientDetails.getRegisteredRedirectUri().toArray()[0].toString())
|
||||
);
|
||||
|
||||
_logger.debug("authorizationUrl "+authorizationUrl);
|
||||
|
||||
modelAndView=WebContext.redirect(authorizationUrl);
|
||||
modelAndView=WebContext.forward("/authz/oauthv20/"+application.getId());
|
||||
}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.OPEN_ID_CONNECT)){
|
||||
// modelAndView=new ModelAndView("openid connect");
|
||||
}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.SAML20)){
|
||||
modelAndView=WebContext.forward("/authz/saml20/idpinit/"+application.getId());
|
||||
}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.TOKENBASED)){
|
||||
modelAndView=WebContext.forward("/authorize/tokenbased/"+id);
|
||||
modelAndView=WebContext.forward("/authz/tokenbased/"+id);
|
||||
}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.CAS)){
|
||||
modelAndView=WebContext.forward("/authz/cas/"+id);
|
||||
}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.DESKTOP)){
|
||||
|
||||
Reference in New Issue
Block a user