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.Cookies;
using Microsoft.AspNet.Authentication.Facebook;
using Microsoft.AspNet.Authentication.Twitter;
using Microsoft.AspNet.Authentication.JwtBearer;
using Microsoft.AspNet.Authentication.OAuth;
using Microsoft.AspNet.Builder;
@ -17,6 +18,7 @@ using OAuth.AspNet.Tokens;
using Yavsc.Auth;
using Yavsc.Extensions;
using Yavsc.Models;
using Microsoft.Extensions.Logging;
namespace Yavsc
{
@ -26,6 +28,8 @@ namespace Yavsc
public static IdentityOptions IdentityAppOptions { get; set; }
public static FacebookOptions FacebookAppOptions { get; private set; }
public static TwitterOptions TwitterAppOptions { get; private set; }
public static OAuthAuthorizationServerOptions OAuthServerAppOptions { get; private set; }
@ -156,6 +160,14 @@ namespace Yavsc
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(
options =>

View File

@ -49,7 +49,15 @@
"Google": {
"ApiKey": "[Your ApiKey]",
"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": [
"Resources/**/*.resx"
],
"namedResource": {
},
"namedResource": {},
"configurations": {
"Debug": {
"compilationOptions": {
@ -108,7 +107,8 @@
"Microsoft.AspNet.Mvc.Formatters.Json": "6.0.0-rc1-final",
"Microsoft.AspNet.OWin": "1.0.0-rc1-final",
"System.Json": "4.0.20126.16343",
"YavscLib": "1.0.0-*"
"YavscLib": "1.0.0-*",
"Extensions.AspNet.Authentication.Instagram": "1.0.0-t150809211713"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel --server.urls http://*:5000",

File diff suppressed because it is too large Load Diff