diff --git a/Rakefile.rb b/Rakefile.rb index 2ac96b8..60d6df0 100644 --- a/Rakefile.rb +++ b/Rakefile.rb @@ -15,7 +15,7 @@ PACKAGES = File.expand_path("packages") TOOLS = File.expand_path("tools") NUGET = File.expand_path("#{TOOLS}/nuget") NUGET_EXE = File.expand_path("#{TOOLS}/nuget/nuget.exe") -@version = "2.11.0" +@version = "2.11.1" PROJECTS = Dir.glob('src/*').select{|dir| File.directory? dir } desc 'Retrieve things' diff --git a/src/Owin.Security.Providers.VKontakte/VKontakteAuthenticationHandler.cs b/src/Owin.Security.Providers.VKontakte/VKontakteAuthenticationHandler.cs index 213ef7c..06bb6c4 100644 --- a/src/Owin.Security.Providers.VKontakte/VKontakteAuthenticationHandler.cs +++ b/src/Owin.Security.Providers.VKontakte/VKontakteAuthenticationHandler.cs @@ -95,6 +95,12 @@ namespace Owin.Security.Providers.VKontakte var user = await GetUser(response, accessToken); var context = CreateAuthenticatedContext(user, accessToken, properties); + var email = response["email"]?.ToString(); + if(!string.IsNullOrWhiteSpace(email)) + { + // Email support. VK send it with access_token + context.Identity.AddClaim(new Claim(ClaimTypes.Email, email, XmlSchemaString, Options.AuthenticationType)); + } await Options.Provider.Authenticated(context); @@ -226,4 +232,4 @@ namespace Owin.Security.Providers.VKontakte return context.IsRequestCompleted; } } -} \ No newline at end of file +}