스프링 부트:이 리소스에 액세스하려면 전체 인증이 필요합니다.
액세스 토큰으로 리소스에 액세스하려고 할 때 이 게시물 https://github.com/angel-git/wso2is-springoauth, 에서 wso2is 서버를 사용한 Spring Boot Security의 예를 보고 있습니다.
{"error":"incertified","error_description":"이 리소스에 액세스하려면 전체 인증이 필요합니다."}
액세스 토큰을 생성하는 방법:
curl -uCLIENT_ID:CLIENT_SECRET-k -d "content-Type=password&password=admin&password=admin" -H "Content-Type:application/x-wwww-form-urlenced" https://localhost:9443/oauthtimeouts
리소스 액세스 방법:
curl -H GET "Access:ACCESS_TOKEN" http://localhost:8080/그리팅
스택 오버플로에서 많은 솔루션을 찾았지만 불행히도 문제를 해결할 수 없었습니다.
도와주세요, 감사합니다.
다음과 같은 오류 메시지가 표시되었습니다.
"curl http://localhost:8080/spring4/beans" :
{"timestamp":1493591079040,"status":401,"error":"Unauthorized","message":"Full authentication is required to access this resource.","path":"/spring4/beans"}
아래 속성 설정application.properties
보안 검사를 무시하고 모든 ACE 엔드포인트를 사용할 수 있습니다.
management.security.enabled=false
문제 해결에 도움을 준 엔젤 가발다에게 많은 감사를 드립니다.다음 명령을 사용하여 액세스 토큰을 생성하고 리소스에 액세스했습니다.
액세스 토큰을 생성하는 경우:-
curl - k - d 'grant_type=client_credentials&client_id=yourClientId&client_secret=yourClientSecret' https://localhost:9443/oauth2/messages
리소스 액세스의 경우:-
curl -k -H "인증:베어러 $ACCESS_TOKEN" http://localhost:8080/그리팅
위의 답변이 이 문제를 해결하지 못할 경우 변경OAuthConfigurations/RemoveOAuthHeadersFromOutMessage
로.false
서류철에api-manager.xml
.
언급URL : https://stackoverflow.com/questions/37612648/spring-boot-full-authentication-is-required-to-access-this-resource
'programing' 카테고리의 다른 글
Apple은 사용자가 개인 API를 사용하고 있는지 어떻게 알 수 있습니까? (0) | 2023.07.10 |
---|---|
왜 GCC는 C보다 C++에 대해 isnan()을 더 효율적으로 구현합니까? (0) | 2023.07.05 |
Spring Data JPA에서 페이지 생성 (0) | 2023.07.05 |
Oracle JDBC Thin Client 식별자 변경 (0) | 2023.07.05 |
스풀 명령:SQL 문을 파일로 출력하지 않음 (0) | 2023.07.05 |