2011-09-20 2 views
0

WP7 망고 WebBrowser 컨트롤에서 Flickr로 OAuth 인증 프로세스에 어려움을 겪고 있습니다. 브라우저에서 예를 들어 "구글"기호가 다음 페이지로 이동 도착 후 :WP7 WebBrowser의 페이지 리디렉션 (Flickr) 문제

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head></head> 
<body dir="" onload="document.forms['f'].submit();"> 
    <form id="f" method="POST" name="f" action="https://open.login.yahoo.com/openid/yrp/return_to?sid=0cbf1840b0b13c261235"> 
    <input name="openid.ns" value="http://specs.openid.net/auth/2.0" type="hidden"> 
    <input name="openid.mode" value="id_res" type="hidden"> 
    <input name="openid.op_endpoint" value="https://www.google.com/accounts/o8/ud" type="hidden"> 
    <input name="openid.response_nonce" value="2011-09-14T10:16:07Zsdv-LClYH0A" type="hidden"> 
    <input name="openid.return_to" value="https://open.login.yahoo.com/openid/yrp/return_to?sid=e7578b76a72f0c261235" type="hidden"> 
    <input name="openid.assoc_handle" value="AOQobUfPBfylWt9AYvILwR347CMGMjh2j4b5jlHe175juowtl05" type="hidden"> 
    <input name="openid.signed" value="op_endpoint,claimed_id,identity,return_to,response_nonce,assoc_handle,ns.ext1,ns.ext2,ext1.mode,ext1.type.fn,ext1.value.fn,ext1.type.gid,ext1.value.gid,ext1.type.em,ext1.value.em,ext1.type.lg,ext1.value.lg,ext1.type.ln,ext1.value.ln,ext2.auth_time,ext2.auth_policies" type="hidden"> 
    <input name="openid.sig" value="e5HFSrO0P+yeRJstJHGJlROUkDvVIDGU=" type="hidden"> 
    <input name="openid.identity" value="https://www.google.com/accounts/o8/id?id=AItOawlmDnO3Bct_YhZlwXpAsU" type="hidden"> 
    <input name="openid.claimed_id" value="https://www.google.com/accounts/o8/id?id=AItOawnO3Bct_YhZlVBwXpAsU" type="hidden"> 
    <input name="openid.ns.ext1" value="http://openid.net/srv/ax/1.0" type="hidden"> 
    <input name="openid.ext1.mode" value="fetch_response" type="hidden"> 
    <input name="openid.ext1.type.fn" value="http://axschema.org/namePerson/first" type="hidden"> 
    <input name="openid.ext1.value.fn" value="John" type="hidden"> 
    <input name="openid.ext1.type.gid" value="http://www.google.com/accounts/api/federated-login/id" type="hidden"> 
    <input name="openid.ext1.value.gid" value="837487387483142978" type="hidden"> 
    <input name="openid.ext1.type.em" value="http://axschema.org/contact/email" type="hidden"> 
    <input name="openid.ext1.value.em" value="[email protected]" type="hidden"> 
    <input name="openid.ext1.type.lg" value="http://axschema.org/pref/language" type="hidden"> 
    <input name="openid.ext1.value.lg" value="en-US" type="hidden"> 
    <input name="openid.ext1.type.ln" value="http://axschema.org/namePerson/last" type="hidden"> 
    <input name="openid.ext1.value.ln" value="Doe" type="hidden"> 
    <input name="openid.ns.ext2" value="http://specs.openid.net/extensions/pape/1.0" type="hidden"> 
    <input name="openid.ext2.auth_time" value="1970-01-01T00:21:55Z" type="hidden"> 
    <input name="openid.ext2.auth_policies" value="http://schemas.openid.net/pape/policies/2007/06/none" type="hidden"> 
    <input name="openid.ns.ext3" value="http://specs.openid.net/extensions/ui/1.0" type="hidden"> 
    <input name="openid.ext3.mode" value="popup" type="hidden"> 
    <noscript><input value="Continue to open.login.yahoo.com" type="submit"></noscript> 
    </form> 
</body> 
</html> 

브라우저가 난 그냥 텍스트로 매우 작은 버튼을 볼 수있는 페이지를로드 "open.login.yahoo 계속 .com "내 의견으로는 사용자 친화적이지 않습니다. 이제 여러분들은 IsScriptEnabled = "True"로 테스트를하지 못했을 것이라고 생각할 것입니다. IsScriptEnabled = "True"로 설정하면 버튼이 숨겨지고 빈 페이지가 나타납니다.

또한 invokeScript 메서드를 사용하여 document.forms [ 'f']. submit()을 실행하려고 시도했지만 응용 프로그램에서 COM 예외가 수신되었습니다.

도와주세요! 어떤 팁이나 제안?

답변

1

저는이 문제로 제 머리카락을 잡아 왔지만 WebBrowser 컨트롤에 몇 가지 변경 사항이있는 것으로 보입니다.

방금 ​​IsScriptEnabled = "True"를 활성화하면 양식 게시가 트리거 된 것으로 보입니다. 그러나 그 전에 나는 작동하는 것처럼 보이는 다른 방법을 시도했다. 하나는 다음 중 하나이다.

loginBrowser.InvokeScript("eval", "document.forms[0].submit()"); 

그러나 마지막 리디렉션 중 하나에 다른 문제가 발생했습니다. 다음에 가면 Flickr 계정의 앱을 승인하기 위해 필요한 서명과 링크를 얻을 수 있습니다 (링크가 짧아지고 작동하지 않습니다).

private void loginBrowser_Navigating(object sender, NavigatingEventArgs e) 
     { 
      if (e.Uri.ToString().Contains("http://www.flickr.com/signin/yahoo/?redir=/services/auth/?mobile=1") && _ishit == false) 
      { 
       _ishit = true; 
       e.Cancel = true; 

      } 
     } 

나는이 사람을 도움이되기를 바랍니다 :

GET /signin/yahoo/?redir=%2Fservices%2Fauth%2F%3Fmobile%3D6%26api_key%3D40d26ecdfghDhr4a1f62219c68d989df%26perms%3Dwrite%26api_sig%3Dcda4de52d6eca8e6db565cf8cd52e1f4&.data=Lnlp...... 

이 솔루션은 다음을이었다!