This commit is contained in:
2017-01-25 10:42:03 +01:00
parent f33e4db462
commit b2bb704c77
4 changed files with 64 additions and 5659 deletions

View File

@ -3,6 +3,7 @@ using System.Security.Claims;
using Microsoft.AspNet.Authentication; using Microsoft.AspNet.Authentication;
using Microsoft.AspNet.Authentication.Cookies; using Microsoft.AspNet.Authentication.Cookies;
using Microsoft.AspNet.Authentication.Facebook; using Microsoft.AspNet.Authentication.Facebook;
using Microsoft.AspNet.Authentication.Twitter;
using Microsoft.AspNet.Authentication.JwtBearer; using Microsoft.AspNet.Authentication.JwtBearer;
using Microsoft.AspNet.Authentication.OAuth; using Microsoft.AspNet.Authentication.OAuth;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
@ -17,6 +18,7 @@ using OAuth.AspNet.Tokens;
using Yavsc.Auth; using Yavsc.Auth;
using Yavsc.Extensions; using Yavsc.Extensions;
using Yavsc.Models; using Yavsc.Models;
using Microsoft.Extensions.Logging;
namespace Yavsc namespace Yavsc
{ {
@ -26,6 +28,8 @@ namespace Yavsc
public static IdentityOptions IdentityAppOptions { get; set; } public static IdentityOptions IdentityAppOptions { get; set; }
public static FacebookOptions FacebookAppOptions { get; private set; } public static FacebookOptions FacebookAppOptions { get; private set; }
public static TwitterOptions TwitterAppOptions { get; private set; }
public static OAuthAuthorizationServerOptions OAuthServerAppOptions { get; private set; } public static OAuthAuthorizationServerOptions OAuthServerAppOptions { get; private set; }
@ -155,6 +159,14 @@ namespace Yavsc
options.Scope.Add("email"); options.Scope.Add("email");
options.UserInformationEndpoint = "https://graph.facebook.com/v2.5/me?fields=id,name,email,first_name,last_name"; options.UserInformationEndpoint = "https://graph.facebook.com/v2.5/me?fields=id,name,email,first_name,last_name";
}); });
branch.UseTwitterAuthentication(options=>
{
TwitterAppOptions = options;
options.ConsumerKey = Configuration["Authentication:Twitter:ClientId"];
options.ConsumerSecret = Configuration["Authentication:Twitter:ClientSecret"];
});
branch.UseOAuthAuthorizationServer( branch.UseOAuthAuthorizationServer(

View File

@ -49,7 +49,15 @@
"Google": { "Google": {
"ApiKey": "[Your ApiKey]", "ApiKey": "[Your ApiKey]",
"ClientId" : "[Your ClientId]", "ClientId" : "[Your ClientId]",
"ClientSecret": "[Your ClientSecret" "ClientSecret": "[Your ClientSecret]"
},
"Facebook": {
"ClientId":"[Your ClientId]",
"ClientSecret":"[Your ClientSecret]"
},
"Twitter": {
"ClientId":"[Your ClientId]",
"ClientSecret":"[Your ClientSecret]"
} }
} }
} }

View File

@ -18,8 +18,7 @@
"resource": [ "resource": [
"Resources/**/*.resx" "Resources/**/*.resx"
], ],
"namedResource": { "namedResource": {},
},
"configurations": { "configurations": {
"Debug": { "Debug": {
"compilationOptions": { "compilationOptions": {
@ -108,7 +107,8 @@
"Microsoft.AspNet.Mvc.Formatters.Json": "6.0.0-rc1-final", "Microsoft.AspNet.Mvc.Formatters.Json": "6.0.0-rc1-final",
"Microsoft.AspNet.OWin": "1.0.0-rc1-final", "Microsoft.AspNet.OWin": "1.0.0-rc1-final",
"System.Json": "4.0.20126.16343", "System.Json": "4.0.20126.16343",
"YavscLib": "1.0.0-*" "YavscLib": "1.0.0-*",
"Extensions.AspNet.Authentication.Instagram": "1.0.0-t150809211713"
}, },
"commands": { "commands": {
"web": "Microsoft.AspNet.Server.Kestrel --server.urls http://*:5000", "web": "Microsoft.AspNet.Server.Kestrel --server.urls http://*:5000",

File diff suppressed because it is too large Load Diff