Skip to content

Commit

Permalink
Исправлены права доступа (#1237)
Browse files Browse the repository at this point in the history
Исправлены права доступа, на данный момент их нужно получать через битовую маску.
  • Loading branch information
igorbgz authored Jun 10, 2022
1 parent 27468e6 commit bc1b5c4
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion examples/VkNet.Uwp/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,37 @@

namespace VkNet.Uwp
{
[Flags]
public enum AccessRights
{
notify = 1,
friends = 2,
photos = 4,
audio = 8,
video = 16,
stories = 64,
pages = 128,
status = 1024,
notes = 2048,
messages = 4096,
wall = 8192,
ads = 32768,
offline = 65536,
docs = 131072,
groups = 262144,
notifications = 524288,
stats = 1048576,
email = 4194304,
market = 134217728
}

/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
AccessRights accessRights = new AccessRights();

public MainPage()
{
this.InitializeComponent();
Expand All @@ -38,7 +64,11 @@ private async void AuthButton_Click(object sender, RoutedEventArgs e)
await message.ShowAsync();
}else
{
var startUri = new Uri($"https://oauth.vk.com/authorize?client_id={ClientId.Text}&display=popup&redirect_uri=https://oauth.vk.com/blank.html&scope={Scope.Text}&response_type=token&v=5.80&state=123456");
//Scope (Access Rights)
accessRights = Enum.Parse<AccessRights>(Scope.Text);
var scope = (int)accessRights;

var startUri = new Uri($"https://oauth.vk.com/authorize?client_id={ClientId.Text}&display=popup&redirect_uri=https://oauth.vk.com/blank.html&scope={scope.ToString()}&response_type=token&v=5.80&state=123456");
var endUri = new Uri("https://oauth.vk.com/blank.html");

//Авторизация в Popup окне с использованием стандартного windows web authentication broker
Expand Down

0 comments on commit bc1b5c4

Please sign in to comment.