This commit is contained in:
MaxKey 2021-02-26 18:09:13 +08:00
parent c888cec376
commit d00421ccfd
6 changed files with 24 additions and 6 deletions

View File

@ -34,7 +34,7 @@ import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.UriComponentsBuilder;
@Controller @Controller
@RequestMapping(value={"/identity/api/org"}) @RequestMapping(value={"/im/api/Organization"})
public class RestOrganizationController { public class RestOrganizationController {
@Autowired @Autowired

View File

@ -35,7 +35,7 @@ import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.UriComponentsBuilder;
@Controller @Controller
@RequestMapping(value={"/identity/api/userinfo"}) @RequestMapping(value={"/im/api/Users"})
public class RestUserInfoController { public class RestUserInfoController {
@Autowired @Autowired
@ -66,6 +66,24 @@ public class RestUserInfoController {
} }
return userInfo; return userInfo;
} }
@RequestMapping(method = RequestMethod.POST)
@ResponseBody
public String changePassword(
@RequestParam(required = true) String username,
@RequestParam(required = true) String password,
UriComponentsBuilder builder) throws IOException {
UserInfo loadUserInfo = userInfoService.loadByUsername(username);
if(loadUserInfo != null) {
UserInfo changePassword = new UserInfo();
changePassword.setId(loadUserInfo.getId());
changePassword.setUsername(username);
changePassword.setPassword(password);
changePassword.setDecipherable(loadUserInfo.getDecipherable());
userInfoService.changePassword(changePassword);
}
return "true";
}
@RequestMapping(value = "/{id}", method = RequestMethod.PUT) @RequestMapping(value = "/{id}", method = RequestMethod.PUT)
@ResponseBody @ResponseBody

View File

@ -19,7 +19,7 @@ package org.maxkey.identity.scim.controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping(value = "/identity/scim/v2/Groups") @RequestMapping(value = "/im/scim/v2/Groups")
public class ScimGroupController { public class ScimGroupController {
} }

View File

@ -45,7 +45,7 @@ import org.springframework.web.util.UriComponentsBuilder;
* http://tools.ietf.org/html/draft-ietf-scim-api-00#section-3 * http://tools.ietf.org/html/draft-ietf-scim-api-00#section-3
*/ */
@RestController @RestController
@RequestMapping(value = "/identity/scim/v2/Organization") @RequestMapping(value = "/im/scim/v2/Organization")
public class ScimOrganizationController { public class ScimOrganizationController {
@RequestMapping(value = "/{id}", method = RequestMethod.GET) @RequestMapping(value = "/{id}", method = RequestMethod.GET)

View File

@ -26,7 +26,7 @@ import java.util.HashSet;
import java.util.Set; import java.util.Set;
@RestController @RestController
@RequestMapping(value = "/identity/scim/v2/ServiceProviderConfig") @RequestMapping(value = "/im/scim/v2/ServiceProviderConfig")
public class ScimServiceProviderConfigController { public class ScimServiceProviderConfigController {
public static final int MAX_RESULTS = 100; public static final int MAX_RESULTS = 100;

View File

@ -44,7 +44,7 @@ import org.springframework.web.util.UriComponentsBuilder;
* http://tools.ietf.org/html/draft-ietf-scim-api-00#section-3 * http://tools.ietf.org/html/draft-ietf-scim-api-00#section-3
*/ */
@RestController @RestController
@RequestMapping(value = "/identity/scim/v2/Users") @RequestMapping(value = "/im/scim/v2/Users")
public class ScimUserController { public class ScimUserController {
@RequestMapping(value = "/{id}", method = RequestMethod.GET) @RequestMapping(value = "/{id}", method = RequestMethod.GET)