문제를 찾았습니다: 헤더가 "Content-Type: application/json"으로 설정되어 있지 않았습니다. 그리고 @qlands의 경우에도 위와 동일하게 설정되어 있지 않은 것을 확인할 수 있습니다.
지금 저에게 남은 유일한 문제는 @nodomain 님과 동일한 것입니다. 계정은 정상적으로 생성되지만 아바타가 포함되지 않습니다. 응답 예시:
Body: {
"access_token":"...",
"token_type":"bearer",
"expires_in":"3600",
"scope":"profile",
"profile" : {
"id":1234,
"email": "...",
"name": "...",
"picture": "https://somedomain.com/somevalidpicture.jpg"
}
}
그리고 이는 올바르게 파싱되고 있으며, 다음 로그에 나타납니다:
OAuth2 Debugging: after_authenticate response:
creds: {"token"=>"...", "expires_at"=>1702053692, "expires"=>true}
uid: 1234
info: {"email"=>"...", "name"=>"...", "avatar"=>"https://somedomain.com/somevalidpicture.jpg"}
extra: {}
이미지 주소가 올바른지 확인했으며, 크기는 300x300입니다.
이 문제에 대해 혹시 아이디어가 있으신가요?
수정: 누군가가 방금 계정을 생성했고, Gravatar에서 이미지를 가져왔습니다. 아마도 JSON의 유효한 이미지가 Gravatar의 빈 결과에 의해 덮어쓰이는 것일까요?
Authentik를 OAuth 제공자로 사용
현재 Authentik을 테스트 중인데, 이 제품과 Discourse에 대한 경험이 있는 분이 계신지 여쭤봅니다.
불행히도 Discourse에 대한 공식 지원 문서를 찾지 못했습니다.
설정할 항목이 꽤 많습니다 ![]()
Portainer는 훨씬 더 간단한 OAuth 구현 방식을 제공합니다.
비교를 위해 Portainer:
안녕하세요? 디스코스와 고스트에 SSO를 Authentik으로 구현하고 싶은데, 현재 제 프로젝트는 보류 상태입니다.
어떤 조언이라도 큰 도움이 될 것 같습니다 ![]()
SSO가 내부 네트워크에 위치해 있고, Discourse가 내부 IP 주소를 사용하여 SSO 사이트에 액세스하려고 할 때 접근할 수 없는 문제를 경험한 분이 계신가요?
tail -f production.log
(oauth2_basic) Setup endpoint detected, running now.
(oauth2_basic) Request phase initiated.
Started POST "/presence/update" for 10.10.10.10 at 2024-06-15 18:19:44 +0000
Processing by PresenceController#update as */*
Parameters: {"client_id"=>"xxx", "present_channels"=>["/chat-user/core/1"]}
Completed 200 OK in 26ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 1895)
Started GET "/auth/oauth2_basic/callback?code=xxxx&state=xxxx" for 10.10.10.10 at 2024-06-15 18:19:49 +0000
(oauth2_basic) Setup endpoint detected, running now.
(oauth2_basic) Callback phase initiated.
OAuth2::ConnectionError (FinalDestination: all resolved IPs were disallowed)
lib/final_destination/ssrf_detector.rb:105:in `lookup_and_filter_ips'
lib/final_destination/http.rb:15:in `connect'
lib/middleware/omniauth_bypass_middleware.rb:43:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:391:in `call'
lib/middleware/csp_script_nonce_injector.rb:12:in `call'
config/initializers/008-rack-cors.rb:14:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:289:in `call'
웹페이지 오류
Oops
The software powering this discussion forum encountered an unexpected problem. We apologize for the inconvenience.
Detailed information about the error was logged, and an automatic notification generated. We'll take a look at it.
No further action is necessary. However, if the error condition persists, you can provide additional detail, including steps to reproduce the error, by posting a discussion topic in the site's feedback category.
방화벽 로그를 확인했지만 차단 기록을 찾을 수 없었습니다! 게다가 Discourse와 SSO 모두 내부 네트워크에 위치해 있으므로 방화벽 차단이나 요청 가로채기 문제가 있을 리 없습니다!
하지만 SSO 사이트의 IP 주소를 외부 공용 네트워크로 지정하면 다시 정상적으로 작동합니다!
이것은 플러그인의 버그인가요, 아니면 제 설정 문제인가요?
내부 SSO 사이트의 호스트 이름을 ‘allowed_internal_hosts’ 사이트 설정에 추가할 수 있습니다. 그러면 Discourse가 해당 사이트와 연결할 수 있습니다.
URL에서 client_id를 appid로 변경하는 방법은 무엇인가요?
제 서버는 appid를 제외하고 URL에서 client_id를 지원하지 않습니다.
플러그인을 수정해야 합니다.
도와주세요
1년이 지났는데도 여전히 이 게시물에 도움을 주고 계시네요! 감사합니다!! 이제 Authentik이 제 환경에서 잘 작동합니다.
안녕하세요, Oauth2를 Zalo와 함께 사용 중인데 첨부된 파일에 있는 문제가 발생했습니다. 원인을 아시는 분 계신가요?
콜백 URL을 다음과 같이 설정했습니다: https://sphere.daviteq.com/auth/basic_oauth2/callback
authentik 설정을 공유해 주실 분 계신가요? 모든 설정이 올바르게 되어 있다고 생각하는데도 계속 (oauth2_basic) 인증 실패! Timeout::Error: Faraday::TimeoutError, Timeout::Error 에러가 나네요.
이 플러그인은 이제 Bundling more popular plugins with Discourse core 에서 언급된 바와 같이 Discourse 코어에 번들로 포함되어 있습니다. 자체 호스팅 환경에서 이 플러그인을 사용하고 계신다면, 다음 업그레이드 전에 app.yml에서 플러그인을 제거해야 합니다.
x-ref


