|
|
|
@ -20,8 +20,7 @@ import org.mitre.oauth2.service.ClientDetailsEntityService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
@ -45,7 +44,7 @@ public class ClientAPI {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
|
|
@RequestMapping("")
|
|
|
|
|
@RequestMapping(method = RequestMethod.GET, headers="application/json")
|
|
|
|
|
public ModelAndView apiGetAllClients(ModelAndView modelAndView) {
|
|
|
|
|
|
|
|
|
|
Collection<ClientDetailsEntity> clients = clientService.getAllClients();
|
|
|
|
@ -55,94 +54,11 @@ public class ClientAPI {
|
|
|
|
|
return modelAndView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*/
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @param modelAndView
|
|
|
|
|
* @param clientId
|
|
|
|
|
* @param clientSecret
|
|
|
|
|
* @param scope
|
|
|
|
|
* @param grantTypes
|
|
|
|
|
* @param redirectUri
|
|
|
|
|
* @param authorities
|
|
|
|
|
* @param name
|
|
|
|
|
* @param description
|
|
|
|
|
* @param allowRefresh
|
|
|
|
|
* @param accessTokenTimeout
|
|
|
|
|
* @param refreshTokenTimeout
|
|
|
|
|
* @param owner
|
|
|
|
|
* @return
|
|
|
|
|
*//*
|
|
|
|
|
|
|
|
|
|
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
|
|
@RequestMapping("/add")
|
|
|
|
|
public ModelAndView apiAddClient(ModelAndView modelAndView,
|
|
|
|
|
@RequestParam String clientId, @RequestParam String clientSecret,
|
|
|
|
|
@RequestParam String scope, // space delimited
|
|
|
|
|
@RequestParam String grantTypes, // space delimited
|
|
|
|
|
@RequestParam(required = false) String redirectUri,
|
|
|
|
|
@RequestParam String authorities, // space delimited
|
|
|
|
|
@RequestParam(required = false) String name,
|
|
|
|
|
@RequestParam(required = false) String description,
|
|
|
|
|
@RequestParam(required = false, defaultValue = "false") boolean allowRefresh,
|
|
|
|
|
@RequestParam(required = false) Long accessTokenTimeout,
|
|
|
|
|
@RequestParam(required = false) Long refreshTokenTimeout,
|
|
|
|
|
@RequestParam(required = false) String owner
|
|
|
|
|
) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @param modelAndView
|
|
|
|
|
* @param clientId
|
|
|
|
|
* @return
|
|
|
|
|
*//*
|
|
|
|
|
|
|
|
|
|
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
|
|
@RequestMapping("/delete")
|
|
|
|
|
public ModelAndView apiDeleteClient(ModelAndView modelAndView,
|
|
|
|
|
@RequestParam String clientId) {
|
|
|
|
|
@RequestMapping(method = RequestMethod.POST, headers="application/json")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ClientDetailsEntity addClient(@RequestBody ClientDetailsEntity c) {
|
|
|
|
|
/*ClientDetailsEntity created = clientService.createClient()
|
|
|
|
|
return created;*/
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* *//**
|
|
|
|
|
*
|
|
|
|
|
* @param modelAndView
|
|
|
|
|
* @param clientId
|
|
|
|
|
* @param clientSecret
|
|
|
|
|
* @param scope
|
|
|
|
|
* @param grantTypes
|
|
|
|
|
* @param redirectUri
|
|
|
|
|
* @param authorities
|
|
|
|
|
* @param name
|
|
|
|
|
* @param description
|
|
|
|
|
* @param allowRefresh
|
|
|
|
|
* @param accessTokenTimeout
|
|
|
|
|
* @param refreshTokenTimeout
|
|
|
|
|
* @param owner
|
|
|
|
|
* @return
|
|
|
|
|
*//*
|
|
|
|
|
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
|
|
@RequestMapping("/update")
|
|
|
|
|
public ModelAndView apiUpdateClient(ModelAndView modelAndView,
|
|
|
|
|
@RequestParam String clientId, @RequestParam String clientSecret,
|
|
|
|
|
@RequestParam String scope, // space delimited
|
|
|
|
|
@RequestParam String grantTypes, // space delimited
|
|
|
|
|
@RequestParam(required = false) String redirectUri,
|
|
|
|
|
@RequestParam String authorities, // space delimited
|
|
|
|
|
@RequestParam(required = false) String name,
|
|
|
|
|
@RequestParam(required = false) String description,
|
|
|
|
|
@RequestParam(required = false, defaultValue = "false") boolean allowRefresh,
|
|
|
|
|
@RequestParam(required = false) Long accessTokenTimeout,
|
|
|
|
|
@RequestParam(required = false) Long refreshTokenTimeout,
|
|
|
|
|
@RequestParam(required = false) String owner
|
|
|
|
|
) {
|
|
|
|
|
return null;
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|