diff --git a/Yavsc/Views/Shared/Authorize.cshtml b/Yavsc/Views/Shared/Authorize.cshtml index 3598a273..76efe101 100644 --- a/Yavsc/Views/Shared/Authorize.cshtml +++ b/Yavsc/Views/Shared/Authorize.cshtml @@ -15,8 +15,8 @@ @foreach (var parameter in Model.Message.Parameters) { } - + diff --git a/Yavsc/Views/Shared/_GetAToken.cshtml b/Yavsc/Views/Shared/_GetAToken.cshtml new file mode 100644 index 00000000..8a217944 --- /dev/null +++ b/Yavsc/Views/Shared/_GetAToken.cshtml @@ -0,0 +1,7 @@ + +
\ No newline at end of file diff --git a/Yavsc/Views/Shared/_LoginPartial.cshtml b/Yavsc/Views/Shared/_LoginPartial.cshtml index 02ad9d5f..6d2e13b5 100755 --- a/Yavsc/Views/Shared/_LoginPartial.cshtml +++ b/Yavsc/Views/Shared/_LoginPartial.cshtml @@ -13,14 +13,6 @@ - - - } else { diff --git a/Yavsc/project.json.new b/Yavsc/project.json.new new file mode 100755 index 00000000..b6089572 --- /dev/null +++ b/Yavsc/project.json.new @@ -0,0 +1,152 @@ +{ + "version": "1.0.0-*", + "authors": [ + "pazof" + ], + "tags": [ + "" + ], + "projectUrl": "http://yavsc.pschneider.fr", + "licenseUrl": "", + "userSecretsId": "aspnet5-YavscWeb-a0dadd21-2ced-43d3-96f9-7e504345102f", + "compilationOptions": { + "emitEntryPoint": true + }, + "compile": [ + "*.cs" + ], + "resource": [ + "Resources/**/*.resx" + ], + "configurations": { + "Debug": { + "compilationOptions": { + "emitEntryPoint": true, + "define": [ + "DEBUG", + "TRACE" + ], + "optimize": false, + "debugType": "full" + } + }, + "Release": { + "compilationOptions": { + "define": [ + "RELEASE", + "TRACE" + ], + "optimize": true + } + } + }, + "webroot": "wwwroot", + "tooling": { + "defaultNamespace": "Yavsc" + }, + "dependencies": { + "EntityFramework.Core": "7.0.0-rc1-*", + "EntityFramework.Relational": "7.0.0-rc1-*", + "EntityFramework.Commands": "7.0.0-rc1-*", + "EntityFramework.Sqlite": "7.0.0-rc1-*", + "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-*", + "EntityFramework7.Npgsql": "3.1.0-*", + "EntityFramework7.Npgsql.Design": "3.1.0-*", + "Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-*", + "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-*", + "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-*", + "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-*", + "Microsoft.AspNet.Mvc": "6.0.0-rc1-*", + "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-*", + "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final", + "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-*", + "Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-*", + "Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-*", + "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-*", + "Microsoft.Extensions.Configuration.Abstractions": "1.0.0-rc1-final", + "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-*", + "Microsoft.Extensions.Logging": "1.0.0-rc1-final", + "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final", + "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final", + "Microsoft.Framework.DependencyInjection": "1.0.0-beta8", + "Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-rc1-final", + "Microsoft.AspNet.Authentication.Facebook": "1.0.0-rc1-final", + "Microsoft.AspNet.Authentication.Twitter": "1.0.0-rc1-final", + "Microsoft.Extensions.Localization": "1.0.0-rc1-final", + "Microsoft.Extensions.Localization.Abstractions": "1.0.0-rc1-final", + "Microsoft.Extensions.Globalization.CultureInfoCache": "1.0.0-rc1-final", + "Microsoft.AspNet.Localization": "1.0.0-rc1-final", + "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4", + "MarkdownDeep-av.NET": "1.5.2", + "Microsoft.Extensions.CodeGeneration": "1.0.0-rc1-final", + "Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final", + "Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final", + "Microsoft.AspNet.Session": "1.0.0-rc1-final", + "Microsoft.NETCore.Platforms": "1.0.1-beta-23516", + "Microsoft.AspNet.SignalR.JS": "2.2.0", + "Microsoft.AspNet.WebSockets.Server": "1.0.0-rc1-final", + "Microsoft.AspNet.Http.Abstractions": "1.0.0-rc1-final", + "Microsoft.AspNet.SignalR.Owin": "1.2.2", + "Microsoft.AspNet.Owin": "1.0.0-rc1-final", + "Microsoft.AspNet.SignalR.Core": "2.2.0", + "Microsoft.AspNet.Server.WebListener": "1.0.0-rc1-final", + "Microsoft.AspNetCore.Authentication.OpenIdConnect": "0.0.1-alpha", + "Microsoft.AspNetCore.Authentication.Cookies": "0.0.1-alpha", + "Microsoft.AspNet.Authentication.OpenIdConnect": "1.0.0-rc1-final", + "MailKit": "1.3.0-beta7", + "Microsoft.Framework.Configuration.Abstractions": "1.0.0-beta8", + "Microsoft.Framework.Configuration.Json": "1.0.0-beta8", + "Microsoft.Framework.DependencyInjection.Abstractions": "1.0.0-beta8", + "Microsoft.Framework.Configuration.Binder": "1.0.0-beta8", + "Microsoft.AspNet.Web.Optimization": "1.1.3", + "PayPalCoreSDK": "1.7.1", + "Microsoft.Extensions.WebEncoders.Core": "1.0.0-rc1-final", + "Microsoft.AspNetCore.Authentication.OAuth": "0.0.1-alpha", + "Microsoft.Extensions.Options": "0.0.1-alpha", + "Microsoft.Extensions.WebEncoders": "1.0.0-rc1-final", + "Google.Apis.Core": "1.11.1", + "Google.Apis": "1.11.1", + "PayPalButtonManagerSDK": "2.10.109", + "Microsoft.AspNet.DataProtection": "1.0.0-rc1-final", + "Microsoft.AspNet.DataProtection.SystemWeb": "1.0.0-rc1-final", + "Microsoft.AspNet.Authentication.JwtBearer": "1.0.0-rc1-final", + "System.IdentityModel.Tokens": "5.0.0-rc1-211161024", + "System.IdentityModel.Tokens.Jwt": "5.0.0-rc1-211161024", + "Microsoft.AspNet.Authorization": "1.0.0-rc1-final", + "AspNet.Security.OpenIdConnect.Server": "1.0.0-beta4" + }, + "commands": { + "web": "Microsoft.AspNet.Server.Kestrel --server.urls http://*:5000", + "lua": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://*:85", + "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://*:5000", + "booking": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://*:87", + "yavsc": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://*:86", + "yavscpre": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://*:84", + "ef": "EntityFramework.Commands", + "gen": "Microsoft.Extensions.CodeGeneration" + }, + "frameworks": { + "dnx451": {} + }, + "exclude": [ + "wwwroot", + "node_modules", + "bower_components", + "contrib" + ], + "publishExclude": [ + "**.user", + "**.vspscc", + "contrib/**/*.*" + ], + "scripts": { + "prebuild": "echo before building", + "postbuild": "echo after building", + "prepack": "gulp min", + "postpack": "echo after packing", + "prerestore": "echo before restoring packages", + "postrestore": "echo after restoring packages", + "prepublish": "gulp min", + "postpublish": "./postPublish.sh" + } +} diff --git a/Yavsc/src/Controllers/OAuthController.cs b/Yavsc/src/Controllers/OAuthController.cs index 0de0fdae..df115106 100644 --- a/Yavsc/src/Controllers/OAuthController.cs +++ b/Yavsc/src/Controllers/OAuthController.cs @@ -182,9 +182,7 @@ namespace Yavsc.Controllers if (!User.Identities.Any(identity => identity.IsAuthenticated)) { return new ChallengeResult(new AuthenticationProperties { - RedirectUri = Url.Action(nameof(Authorize), new { - unique_id = request.GetUniqueIdentifier() - })}); + RedirectUri = Url.Action(nameof(Authorize), request.BuildRedirectUrl())}); } // Note: ASOS automatically ensures that an application corresponds to the client_id specified // in the authorization request by calling IOpenIdConnectServerProvider.ValidateAuthorizationRequest. @@ -204,18 +202,13 @@ namespace Yavsc.Controllers } // Note: in a real world application, you'd probably prefer creating a specific view model. - return View("Authorize", new AuthorisationView { Message = request, Application = application}); + return View("Authorize", new AuthorisationView { Message = request, + Application = application}); } - [HttpPost("~/connect/authorize/accept"), ValidateAntiForgeryToken] + [HttpPost("~/connect/authorize/accept"),Authorize] public async Task