В своем приложении на Adobe Air я сделал вход через браузер на Одноклассники, ВКонтакте, Фейсбук, Google+ и Мой мир:

Вот программный код для Apache Flex:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
viewActivate="loadInfo(event)"
viewDeactivate="closeSWV(event)"
title="Vk.com">
<fx:Declarations>
<s:MultiDPIBitmapSource id="BACK"
source160dpi="@Embed('assets/icons/160/back.png')"
source240dpi="@Embed('assets/icons/240/back.png')"
source320dpi="@Embed('assets/icons/320/back.png')"
source480dpi="@Embed('assets/icons/480/back.png')"
source640dpi="@Embed('assets/icons/640/back.png')" />
<s:MultiDPIBitmapSource id="RELOAD"
source160dpi="@Embed('assets/icons/160/reload.png')"
source240dpi="@Embed('assets/icons/240/reload.png')"
source320dpi="@Embed('assets/icons/320/reload.png')"
source480dpi="@Embed('assets/icons/480/reload.png')"
source640dpi="@Embed('assets/icons/640/reload.png')" />
</fx:Declarations>
<s:states>
<s:State name="portrait"/>
<s:State name="landscape"/>
</s:states>
<s:navigationContent>
<s:Button icon="{BACK}" click="navigator.popView()"/>
</s:navigationContent>
<s:actionContent>
<s:BusyIndicator id="_busy"
symbolColor="0xFFFFFF"
visible="false"
includeInLayout="false" />
<s:Button id="_reload"
icon="{RELOAD}"
click="clearInfo(event)"
visible="false"
includeInLayout="false" />
</s:actionContent>
<fx:Script>
<![CDATA[
import com.brokenfunction.json.decodeJson;
import flash.media.StageWebView;
import flash.net.navigateToURL;
import spark.events.ViewNavigatorEvent;
import assets.avatars.male_happy;
private static const KEY:String = 'VK';
private static const APP_ID:String = '1234567';
//private static const APP_SECRET:String = 'oXoXoXoXoXoXoXoXoXoX';
private static const APP_URL:String = 'http://oauth.vk.com/blank.html';
private static const AUTH_URL:String = 'http://oauth.vk.com/authorize?';
private var _swv:StageWebView;
private function openSWV(event:Event=null):void {
_busy.visible = _busy.includeInLayout = true;
_reload.visible = _reload.includeInLayout = false;
_swv = new StageWebView();
_swv.addEventListener(Event.COMPLETE, extractAccessToken);
_swv.addEventListener(LocationChangeEvent.LOCATION_CHANGE, extractAccessToken);
_swv.addEventListener(IOErrorEvent.IO_ERROR, closeSWV);
_swv.addEventListener(ErrorEvent.ERROR, closeSWV);
stage.addEventListener(Event.RESIZE, resizeSWV);
_swv.stage = stage;
resizeSWV();
var reqVars:URLVariables = new URLVariables();
reqVars.client_id = APP_ID;
reqVars.display = 'touch';
reqVars.response_type = 'token';
reqVars.redirect_uri = APP_URL;
_swv.loadURL(AUTH_URL + reqVars);
}
private function closeSWV(event:Event=null):void {
_busy.visible = _busy.includeInLayout = false;
_reload.visible = _reload.includeInLayout = true;
stage.removeEventListener(Event.RESIZE, resizeSWV);
if (! _swv)
return;
_swv.removeEventListener(Event.COMPLETE, extractAccessToken);
_swv.removeEventListener(LocationChangeEvent.LOCATION_CHANGE, extractAccessToken);
_swv.removeEventListener(IOErrorEvent.IO_ERROR, closeSWV);
_swv.removeEventListener(ErrorEvent.ERROR, closeSWV);
_swv.dispose();
_swv = null;
}
private function resizeSWV(event:Event=null):void {
if (! _swv)
return;
// align to the right-bottom corner
_swv.viewPort = new Rectangle(stage.stageWidth - Preferans.SCALE * width,
stage.stageHeight - Preferans.SCALE * height,
Preferans.SCALE * width,
Preferans.SCALE * height);
}
private function extractAccessToken(event:Event):void {
trace('title: ' + _swv.title);
trace('location: ' + _swv.location);
var access_token:String = getValue('access_token=', _swv.location);
var user_id:String = getValue('user_id=', _swv.location);
if (access_token && user_id) {
trace('access_token=' + access_token);
trace('user_id=' + user_id);
closeSWV();
fetchInfo(access_token, user_id);
}
}
private function fetchInfo(access_token:String, userid:String):void {
var reqVars:Array = new Array();
reqVars.push('user_ids=' + userid);
//reqVars.push('access_token=' + access_token);
reqVars.push('fields=city,photo_big,sex');
reqVars.push('v=5.10');
var req:URLRequest = new URLRequest();
req.url = 'https://api.vk.com/method/users.get?' + reqVars.join('&');
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, handleComplete);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handleError);
loader.addEventListener(IOErrorEvent.IO_ERROR, handleError);
try {
loader.load(req);
_busy.visible = _busy.includeInLayout = true;
_reload.visible = _reload.includeInLayout = false;
} catch (error:Error) {
trace(error);
}
}
private function handleError(event:ErrorEvent):void {
_busy.visible = _busy.includeInLayout = false;
_reload.visible = _reload.includeInLayout = true;
var loader:URLLoader = URLLoader(event.target);
trace(event.text);
trace(loader.data);
}
private function handleComplete(event:Event):void {
_busy.visible = _busy.includeInLayout = false;
_reload.visible = _reload.includeInLayout = true;
var obj:Object;
var loader:URLLoader = URLLoader(event.target);
trace(loader.data);
try {
obj = decodeJson(loader.data, true)['response'][0];
saveInfo(obj);
loadInfo(null, false);
} catch (e:Error) {
trace('Invalid JSON: ' + loader.data);
}
}
private function clearInfo(obj:Object):void {
data = null;
delete (Preferans.SO.data)[KEY];
Preferans.SO.flush();
loadInfo();
}
private function saveInfo(obj:Object):void {
data = {
ID: KEY + obj.id,
AUTH: Preferans.GENERATE_HASH(obj.id),
FIRST: obj.first_name,
LAST: obj.last_name,
FEMALE: (obj.sex != 2),
AVATAR: obj.photo_big
};
try {
data.CITY = obj.city.title;
} catch (e:Error) {
// ignore eventual null pointer
}
(Preferans.SO.data)[KEY] = data;
Preferans.SO.flush();
Preferans.ID = data.ID;
Preferans.AUTH = data.AUTH;
Preferans.FIRST = data.FIRST;
}
private function loadInfo(event:ViewNavigatorEvent=null, displaySWV:Boolean=true):void {
localize();
data = (Preferans.SO.data)[KEY];
if (Preferans.CHECK_INFO(data)) {
_first.text = resourceManager.getString('resources', 'login.first') + ' ' + data.FIRST;
_gender.text = resourceManager.getString('resources', 'login.gender') + ' ' +
(data.FEMALE ? resourceManager.getString('resources', 'login.female') :
resourceManager.getString('resources', 'login.male'));
_city.text = resourceManager.getString('resources', 'login.city') + ' ' + (data.CITY ? data.CITY : '');
// will be displayed in Avatar.mxml, do not scale down
data.zoom = Preferans.avatarRequest(
data.AVATAR as String,
data.FEMALE as Boolean
);
_avatar.source = Preferans.avatarRequest(
data.AVATAR as String,
data.FEMALE as Boolean,
Preferans.AVATAR_WIDTH,
Preferans.AVATAR_HEIGHT
);
_busy.visible = _busy.includeInLayout = false;
_reload.visible = _reload.includeInLayout = true;
_play.visible = _play.includeInLayout = true;
} else {
_play.visible = _play.includeInLayout = false;
if (displaySWV)
openSWV();
}
}
private function getValue(key:String, str:String):String {
const pattern:RegExp = /[-_a-zA-Z0-9\/.]+/;
var index:int = str.indexOf(key);
if (index > -1) {
var matches:Array = str.substring(index + key.length).match(pattern);
if (matches.length > 0)
return matches[0];
}
return null;
}
private function showProfile(event:MouseEvent):void {
navigateToURL(new URLRequest('http://preferans.de/' + data.ID));
}
private function startGame(event:MouseEvent):void {
var ngames:int = int(Preferans.SO.data.NGAMES);
ngames = (isNaN(ngames) ? 1 : ngames + 1);
Preferans.SO.data.NGAMES = ngames;
Preferans.SO.data.LAST_KEY = KEY;
Preferans.SO.flush();
navigator.pushView(Main, data);
}
private function zoomAvatar(event:MouseEvent):void {
navigator.pushView(Avatar, data);
}
private function localize():void {
_desc.text = resourceManager.getString('resources', 'login.desc');
_first.text = resourceManager.getString('resources', 'login.first');
_gender.text = resourceManager.getString('resources', 'login.gender');
_city.text = resourceManager.getString('resources', 'login.city');
_play.label = resourceManager.getString('resources', 'login.play');
}
]]>
</fx:Script>
<s:layout.portrait>
<s:VerticalLayout horizontalAlign="center"
paddingLeft="{Preferans.PADDING}"
paddingTop="{Preferans.PADDING}"
gap="{Preferans.PADDING}" />
</s:layout.portrait>
<s:layout.landscape>
<s:HorizontalLayout verticalAlign="middle"
paddingLeft="{Preferans.PADDING}"
paddingTop="{Preferans.PADDING}"
gap="{Preferans.PADDING}" />
</s:layout.landscape>
<s:Group click="zoomAvatar(event)">
<s:BitmapImage id="_avatar"
width="{Preferans.AVATAR_WIDTH}"
height="{Preferans.AVATAR_HEIGHT}"
scaleMode="letterbox"
source="{male_happy}"
contentLoader="{Preferans.AVATAR_CACHE}" />
</s:Group>
<s:VGroup paddingTop="{Preferans.PADDING}"
paddingLeft="{Preferans.PADDING}"
paddingRight="{Preferans.PADDING}"
paddingBottom="{Preferans.PADDING}">
<s:VGroup>
<s:Label id="_desc" />
<s:Label id="_first" />
<s:Label id="_gender" />
<s:Label id="_city" />
</s:VGroup>
</s:VGroup>
<s:Button id="_play"
click="startGame(event)"
includeInLayout="false"
visible="false" />
</s:View>