|
|
@ -1,13 +1,13 @@ |
|
|
|
package com.cloud.kicc.common.security.exp; |
|
|
|
package com.cloud.kicc.common.security.exp; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.http.HttpStatus; |
|
|
|
import cn.hutool.http.HttpStatus; |
|
|
|
import com.cloud.kicc.common.core.constant.CommonConstants; |
|
|
|
|
|
|
|
import com.cloud.kicc.common.core.api.R; |
|
|
|
import com.cloud.kicc.common.core.api.R; |
|
|
|
|
|
|
|
import com.cloud.kicc.common.core.constant.CommonConstants; |
|
|
|
import com.cloud.kicc.common.core.enums.ExceptionEnum; |
|
|
|
import com.cloud.kicc.common.core.enums.ExceptionEnum; |
|
|
|
import com.cloud.kicc.common.security.exception.UnConfiguredUserDataException; |
|
|
|
import com.cloud.kicc.common.security.exception.UnConfiguredUserDataException; |
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
|
|
|
import lombok.SneakyThrows; |
|
|
|
import lombok.SneakyThrows; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.security.authentication.InsufficientAuthenticationException; |
|
|
|
import org.springframework.security.authentication.InsufficientAuthenticationException; |
|
|
|
import org.springframework.security.core.AuthenticationException; |
|
|
|
import org.springframework.security.core.AuthenticationException; |
|
|
|
import org.springframework.security.web.AuthenticationEntryPoint; |
|
|
|
import org.springframework.security.web.AuthenticationEntryPoint; |
|
|
@ -25,10 +25,10 @@ import java.io.PrintWriter; |
|
|
|
* @Author: wangxiang4 |
|
|
|
* @Author: wangxiang4 |
|
|
|
* @Date: 2022/2/17 |
|
|
|
* @Date: 2022/2/17 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@RequiredArgsConstructor |
|
|
|
|
|
|
|
public class ResourceAuthExceptionEntryPoint implements AuthenticationEntryPoint { |
|
|
|
public class ResourceAuthExceptionEntryPoint implements AuthenticationEntryPoint { |
|
|
|
|
|
|
|
|
|
|
|
private final ObjectMapper objectMapper; |
|
|
|
@Autowired |
|
|
|
|
|
|
|
private ObjectMapper objectMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@SneakyThrows |
|
|
|
@SneakyThrows |
|
|
|