public VKLoginWindow(String appId, VKAuthScope[] scope) { InitializeComponent(); Uri uri = AuthHelper.GetAuthUri(appId, scope, VKAuthDisplay.popup); webBrowser.Navigated += new System.Windows.Navigation.NavigatedEventHandler(webBrowser_Navigated); webBrowser.Navigate(uri); }
public static Uri GetAuthUri(String appId, VKAuthScope[] scope, VKAuthDisplay display) { return new Uri(GetAuthString(appId, scope, display), UriKind.Absolute); }
public static String GetAuthString(String appId, VKAuthScope[] scope, VKAuthDisplay display) { return String.Format(@"http://oauth.vkontakte.ru/authorize?client_id={0}&scope={1}&display=popup&response_type=token", appId, String.Join(",", scope.Select(s => s.GetOverridenString()))); }