your programing

localhost를 사용할 때 Facebook 앱 도메인 이름

lovepro 2020. 10. 6. 18:50
반응형

localhost를 사용할 때 Facebook 앱 도메인 이름


여기 튜토리얼에서 :
http://ankurm.com/blog/api/using-localhost-for-facebook-app-development/1091/

Facebook 앱을위한 지역 개발 영역을 설정하려고했습니다. 하지만 내 도메인 이름으로 " http : // localhost : 85 / my_app / "을 입력하면 Facebook에

앱 도메인 : " http : // localhost : 85 / app-name / "은 프로토콜 정보를 포함 할 수 없습니다.

또한 "localhost : 85 / my_app /"를 내 도메인 이름으로 입력하면 오류가 발생합니다.

앱 도메인 : localhost : 85 / my_app /은 유효한 도메인이 아닙니다.


프로토콜이 변경된 것 같습니다.

내 솔루션은 다음과 같습니다 (2015 년 4 월 3 일에 테스트했으며 잘 작동합니다).

에서 설정 -> 기본

  1. 앱 도메인 : localhost
  2. " + 플랫폼 추가 "를 클릭 하고 " 웹 사이트 "를 선택합니다.
  3. 사이트 URL : http : // localhost : <port> / ( <port> 는 포트 번호입니다.)
  4. 변경 사항을 저장하다

내 솔루션 :

  1. 앱 도메인은 비워 둡니다.
  2. (제품) Facebook 로그인> 설정
  3. 추가 http://localhost:85/my_app/Valid OAuth redirect URIs상자
  4. 변경 사항을 저장하다

  1. 앱 도메인은 비워 둡니다.
  2. Facebook 로그인으로 웹 사이트로 이동
  3. 더하다 http://localhost:port_number/
  4. 변경 사항을 저장하고 다시 시도하십시오. 자세한 내용은

http://developers.facebook.com/docs/samples/canvas/ 해피 코딩 :-)


이것은 수년에 걸쳐 일부 변경되었지만 localhost에서 실행중인 웹 응용 프로그램과 함께 작동하도록했습니다. 이것이 내가 한 일입니다.

  1. 고토 https://developers.facebook.com/apps
  2. 앱을 선택하십시오.
  3. 왼쪽 탐색 모음에서 설정> 기본을 선택합니다.
  4. 페이지 하단의 플랫폼 추가 버튼을 클릭합니다.
  5. 웹 사이트 클릭
  6. http://localhost:8080/사이트 URL을 입력 합니다.
  7. 방금 입력 한 사이트 URL의 맨 오른쪽에있는 빠른 시작 버튼을 클릭합니다.
  8. 새 탭이 열립니다. 해당 탭에서 "웹 사이트 정보"섹션까지 아래로 스크롤 http://localhost:8080/한 다음 사이트 URL을 다시 입력 합니다.
  9. 다음 버튼을 클릭하십시오.
  10. 다시 로그인을 시도했으며 이번에는 작동했습니다.

행운을 빕니다!


2018 작업 솔루션

이것을 알아내는 데 시간이 많이 걸렸으므로 솔루션을 공유하겠습니다.

나는 모든 제안 된 답변을 시도했지만 아무것도 효과가 없었고 결국 내가해야 할 일은 https://developers.facebook.com/apps/YOUR_APP_ID/fb-login/settings/ 로 이동하여 유효한 OAuth 리디렉션 URI 상자 에 전체 콜백 URL .

제 경우에는 레일에 루비를 사용하면 URL이 다음과 같이 보입니다 http://localhost:3000/user/auth/facebook/callback.

그리고 그것을 추가하자마자 모든 것이 작동하기 시작했습니다! 이것이이 문제에 직면 한 다른 사람에게 도움이되기를 바랍니다.


이것이 제가하던 일입니다.

Windows를 사용하는 경우 호스트 파일을 수정해야합니다. 호스트 파일 위치는%SystemRoot%\System32\drivers\etc\

다음과 같이 호스트 파일에 새 줄을 추가하십시오.

127.0.0.1    localhost.YOUR-SITE-NAME.com

호스트 파일을 저장하십시오.

FB 앱 설정 제어판으로 이동하여 localhost.YOUR-SITE-NAME.comApps 도메인 필드에 제공하십시오. 변경 사항을 저장하다.

이제 localhost.YOUR-SITE-NAME.com브라우저에서 와 같은 로컬 환경을로드 하십시오.

주의 : 귀하의 도메인 이름으로 귀하의 사이트 이름을 변경하십시오.


작업 솔루션 (2018 년 8 월)

먼저 개발자 대시 보드 에서 앱을 선택합니다 .

Then make sure your app is in development mode, as it allows localhost over HTTP. To do so, click on the toggle situated at the top right of your app's page.

Finally, please follow the notes below as they could cause trouble if improperly filled:

  • Settings > Basic > App Domains should be empty
  • Products > Facebook Login > Settings > Valid OAuth Redirect URIs should be empty

You can either leave it blank or use localhost, http://localhost:85/my_app/ is the URL


When I wrote that tutorial at that time port was allowed in app domain. And I actually able to run app with 81 port (wamp server). Now it looks that facebook is not allowing port in url. You can use localhost in app domain.

I will update information as soon as possible. I am trying to find out solution.

A temporary solution is use localtunnel http://progrium.com/localtunnel/


You must create a tunnel to share your localhost; Ngrok is maby the easiest way to do that.


https://ngrok.com

Go through https://ngrok.com/ link to download ngrok and extract that file. Open cmd ( search cmd) Go to directory where ngrok is extracted. Open ngrok from command line ex: c:/ngrok/ngrok.exe [port] or cd c:/ngrok then ngrok 80 ( ngrok [port] ) You will get

ngrok

Tunnel Status                 online
Version                       1.3/1.3
Forwarding                    http://3ahsdfhska.ngrok.com -> 127.0.0.1:80
Forwarding                    https://3ahsdfhska.ngrok.com -> 127.0.0.1:80
Web Interface                 http://127.0.0.1:4040
# Conn                        0
Avg Conn Time                 0.00ms

Don’t FORGET to make sure your wamp server is open on same port … (how to check -> goto->wampicon->apache->httpd.conf search for port or 80(default) use that for ngrok.exe 80 )

http://3ahsdfhska.ngrok.com

will be URL for accessing your localhost online


If you are getting the protocol errors, not only do you need to REMOVE the Http:// but also if there is any backslash at the end of the web address, you must remove that too or it won't work. I did this and it worked perfectly! Holla!


Tossing one more solution into the mix:

I set up my website per the instructions, then added a second app (Facebook Canvas) and set that URL to http://localhost:XXXXX. Now I can access FB both locally and in production.


I develop locally and I use this URL: localhost/fb

Then I had to add a website with the following URL: http://localhost

Under App Domains I added localhost.

Now it works. The only issue I had was, that you have to use this URL in all of your scripts. E.g.

$loginUrl = $helper->getLoginUrl('http://localhost/fb/login-callback.php', $permissions);

You can't use 127.0.0.1 here ...


I tried all the solutions mentioned here but none of them worked.

What solved my issue was copying the "OAuth redirect URI" from firebase to facebook app "Valid OAuth Redirect URIs"

I left all the domains blank

참고URL : https://stackoverflow.com/questions/13376710/facebook-app-domain-name-when-using-localhost

반응형