oidc wellknown接口优化

This commit is contained in:
shimingxy 2024-10-31 18:27:08 +08:00
parent 9896c141ef
commit fb48d582f0
3 changed files with 8 additions and 7 deletions

View File

@ -48,8 +48,8 @@ public class OauthJwksEndpoint extends AbstractEndpoint {
method={RequestMethod.POST, RequestMethod.GET}) method={RequestMethod.POST, RequestMethod.GET})
@ResponseBody @ResponseBody
public String keysMetadataByParam(HttpServletRequest request , HttpServletResponse response, public String keysMetadataByParam(HttpServletRequest request , HttpServletResponse response,
@RequestParam(required = false) String inst_id, @RequestParam(value="inst_id",required = false) String inst_id,
@RequestParam(required = false) String client_id) { @RequestParam(value="client_id",required = false) String client_id) {
return buildMetadata(request,response,inst_id,client_id,ContentType.JSON); return buildMetadata(request,response,inst_id,client_id,ContentType.JSON);
} }
@ -58,7 +58,8 @@ public class OauthJwksEndpoint extends AbstractEndpoint {
method={RequestMethod.POST, RequestMethod.GET}) method={RequestMethod.POST, RequestMethod.GET})
@ResponseBody @ResponseBody
public String keysMetadatabyPath(HttpServletRequest request , HttpServletResponse response, public String keysMetadatabyPath(HttpServletRequest request , HttpServletResponse response,
@PathVariable String instId,@PathVariable String clientId) { @PathVariable(value="instId") String instId,
@PathVariable(value="clientId") String clientId) {
return buildMetadata(request,response,instId,clientId,ContentType.JSON); return buildMetadata(request,response,instId,clientId,ContentType.JSON);
} }
@ -68,8 +69,8 @@ public class OauthJwksEndpoint extends AbstractEndpoint {
method={RequestMethod.POST, RequestMethod.GET}) method={RequestMethod.POST, RequestMethod.GET})
@ResponseBody @ResponseBody
public String metadata(HttpServletRequest request , HttpServletResponse response, public String metadata(HttpServletRequest request , HttpServletResponse response,
@PathVariable(value="clientId", required = false) String clientId, @PathVariable(value="clientId") String clientId,
@PathVariable(value="mediaType", required = false) String mediaType) { @PathVariable(value="mediaType") String mediaType) {
return buildMetadata(request,response,null,clientId,mediaType); return buildMetadata(request,response,null,clientId,mediaType);
} }

View File

@ -99,7 +99,7 @@ public class OauthAuthorizationServerEndpoint extends AbstractEndpoint {
jwksUri.append("?"); jwksUri.append("?");
jwksUri.append("client_id").append("=").append(clientDetails.getClientId()); jwksUri.append("client_id").append("=").append(clientDetails.getClientId());
if(StringUtils.isNotBlank(instId)) { if(StringUtils.isNotBlank(instId)) {
jwksUri.append("&").append("inst_id").append("=").append(clientDetails.getClientId()); jwksUri.append("&").append("inst_id").append("=").append(instId);
} }
oauthConfig.setJwks_uri(jwksUri.toString()); oauthConfig.setJwks_uri(jwksUri.toString());
}else { }else {

View File

@ -93,7 +93,7 @@ public class OpenidConfigurationEndpoint extends AbstractEndpoint {
jwksUri.append("?"); jwksUri.append("?");
jwksUri.append("client_id").append("=").append(clientDetails.getClientId()); jwksUri.append("client_id").append("=").append(clientDetails.getClientId());
if(StringUtils.isNotBlank(instId)) { if(StringUtils.isNotBlank(instId)) {
jwksUri.append("&").append("inst_id").append("=").append(clientDetails.getClientId()); jwksUri.append("&").append("inst_id").append("=").append(instId);
} }
openidConfig.setJwks_uri(jwksUri.toString()); openidConfig.setJwks_uri(jwksUri.toString());
}else { }else {