2011-04-23 6 views
3

안드로이드가 아니라 데스크톱 용 어도비 AIR에서 작동하는 핀없는 OAuth를 얻었습니다. 어떤 이유로 든 Android 장치의 StageWebView에 oauth_verifier ( sha 코드가 포함되어 있음)가 표시되지 않습니다. 어떤 단서? 다음은 데스크톱 및 Droid 2 용 디버그입니다. 콜백 URL 뒤에 모든 OAuth 변수가 누락 된 Droid 2 추적 출력의 세 번째 줄을 확인하십시오.안드로이드 용 어도비 AIR 용 핀리스 OAuth

데스크톱 : 2

AuthorizeTwitterService::onComplete, data: 
oauth_token=De2k4zANjzAhT3hXV4eqOfTVxJsshVIJjgsuwPMUg8&oauth_token_secret=s  WsBzyS43nh6DDBwLaogaWpVftoDaiYTJDfBKQE&oauth_callback_confirmed=true 
-------------------- 
TwitterLoginView::onLocationChange 
location: 
https://api.twitter.com/oauth/authorize?oauth_callback=oob&applicatio... 
-------------------- 
TwitterLoginView::onLocationChange 
location: https://api.twitter.com/oauth/authorize 
-------------------- 
TwitterLoginView::onLocationChange 
location: 
http://www.twitter.com/combovercharlie?oauth_token=De2k4zANjzAhT3hXV4&oauth_verifier=js1B4bAYfUer05a2rlZSDcOLOaIa66q93K24FUzrk 

이드 :

AuthorizeTwitterService::onComplete, data: 
oauth_token=BtwJHbpaS5OWy1AMYdwl0ecGKGpU9AEcyrFYaXQ8&oauth_token_secret=Z2C  ff3ECfY5dp8dLLSA9qXvL2SRaZ3v5veStGuA00&oauth_callback_confirmed=true 
-------------------- 
TwitterLoginView::onLocationChange 
location: 
https://api.twitter.com/oauth/authorize?oauth_callback=oob&applicatio... 
Charlie&oauth_token=BtwJHbpaS5OWy1AMYdwl0ecGKGpU9AEcyrFYaXQ8&oauth_consumer  _key=LbMYslVau91uSAMZyGsOg 
-------------------- 
TwitterLoginView::onLocationChange 
location: https://api.twitter.com/oauth/authorize 
-------------------- 
TwitterLoginView::onLocationChange 
location: http://mobile.twitter.com/combovercharlie 

답변

0

나는 내 드로이드 2, 넥서스 원에 대한하면 Event.COMPLETE를 통해 그것을 해결했습니다. 내 바탕 화면이나 Android에서도 LocationChangeEvent.LOCATION_CHANGING을 얻지 못하고 있지만, 결론적으로 Event.COMPLETE는 oauth_verifier sha 핀을 얻습니다. StageWebView의 위치 속성에서 파싱 할 수 있습니다. 제출해 주셔서 감사합니다. 편집증에서 벗어나 3 가지 이벤트를 모두 남겨두고 있습니다. 궁금한 점이 있으시면 Mark Lochrie : http://kb2.adobe.com/cps/895/cpsid_89526.html을 통한 OS 간의 리디렉션 이벤트 차이점을 참조하십시오.

또한 실제로 응용 프로그램이 데스크톱 응용 프로그램이 아닌 "웹 응용 프로그램"으로 등록되어 있다고 가정합니다. 그렇지 않으면 핀을 사용해야하며 응답 URL에 oauth_verifier가 표시되지 않습니다 . 네, 원하는 콜백 URL을 만들 수 있습니다. 잘하면 404가 아닌 표준 URL인지 확인하십시오.

stageWebView = new StageWebView(); 
stageWebView.addEventListener(LocationChangeEvent.LOCATION_CHANGING, onLocationChange); 
stageWebView.addEventListener(LocationChangeEvent.LOCATION_CHANGE, onLocationChange); 
stageWebView.addEventListener(Event.COMPLETE, onLocationChange); 
stageWebView.stage = stage; 
stageWebView.viewRect = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight); 
// loaded from an OAuth library 
// try http://code.google.com/p/oauth-as3/ or Tweetr http://wiki.swfjunkie.com/tweetr 
stageWebView.loadURL(authenticationURL); 

var code:String; 

function onLocationChange(event:Event):void 
{ 
     var location:String; 

    if(event is LocationChangeEvent) 
    { 
     location = LocationChangeEvent(event).location; 
    } 
    else 
    { 
     location = _stageWebView.location; 
    } 

    var search:String  = "oauth_verifier="; 
    var ver:String   = location; 
    var startIndex:int  = ver.lastIndexOf(search); 
    if(startIndex != -1) 
    { 
     code = ver.substr(startIndex + search.length, location.length); 
     // remove listeners and dispatch success here 
    } 
}