()
19 | .UseApplicationInsights()
20 | .Build();
21 |
22 | host.Run();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Sample/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:8550/",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "Sample": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "environmentVariables": {
22 | "ASPNETCORE_ENVIRONMENT": "Development"
23 | },
24 | "applicationUrl": "http://localhost:8551"
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Sample/Sample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net47
5 |
6 |
7 |
8 | $(PackageTargetFallback);portable-net45+win8+wp8+wpa81;
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Sample/Startup.cs:
--------------------------------------------------------------------------------
1 | using AspNetCore.Authentication.WsFederation;
2 | using Microsoft.AspNetCore.Authentication.Cookies;
3 | using Microsoft.AspNetCore.Builder;
4 | using Microsoft.AspNetCore.Hosting;
5 | using Microsoft.Extensions.Configuration;
6 | using Microsoft.Extensions.DependencyInjection;
7 | using Microsoft.Extensions.Logging;
8 |
9 | namespace Sample
10 | {
11 | public class Startup
12 | {
13 | public Startup(IHostingEnvironment env)
14 | {
15 | var builder = new ConfigurationBuilder()
16 | .SetBasePath(env.ContentRootPath)
17 | .AddJsonFile("appsettings.json", false, true)
18 | .AddJsonFile($"appsettings.{env.EnvironmentName}.json", true)
19 | .AddEnvironmentVariables();
20 | Configuration = builder.Build();
21 | }
22 |
23 | public IConfigurationRoot Configuration { get; }
24 |
25 | // This method gets called by the runtime. Use this method to add services to the container.
26 | public void ConfigureServices(IServiceCollection services)
27 | {
28 | // Add framework services.
29 | services.AddMvc();
30 | services.AddAuthentication(
31 | options => options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme);
32 | }
33 |
34 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
35 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
36 | {
37 | loggerFactory.AddConsole(Configuration.GetSection("Logging"));
38 | loggerFactory.AddDebug();
39 |
40 | if (env.IsDevelopment())
41 | {
42 | app.UseDeveloperExceptionPage();
43 | app.UseBrowserLink();
44 | }
45 | else
46 | {
47 | app.UseExceptionHandler("/Home/Error");
48 | }
49 |
50 | app.UseCookieAuthentication(new CookieAuthenticationOptions()
51 | {
52 | AutomaticChallenge = true,
53 | ReturnUrlParameter = "source"
54 | });
55 |
56 | app.UseWsFederationAuthentication(new WsFederationAuthenticationOptions
57 | {
58 | Wtrealm = "https://cdrobisonxactware.onmicrosoft.com/eb81d25f-9da5-4ed9-af4d-709769a91c6a",
59 | MetadataAddress =
60 | "https://login.windows.net/96708752-4aec-4318-beca-c25ff9bffc1f/FederationMetadata/2007-06/FederationMetadata.xml"
61 | });
62 |
63 | app.UseStaticFiles();
64 |
65 | app.UseMvc(routes =>
66 | {
67 | routes.MapRoute(
68 | "default",
69 | "{controller=Home}/{action=Index}/{id?}");
70 | });
71 | }
72 | }
73 | }
--------------------------------------------------------------------------------
/Sample/Views/Home/About.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "About";
3 | }
4 | @ViewData["Title"].
5 | @ViewData["Message"]
6 |
7 | Use this area to provide additional information.
8 |
--------------------------------------------------------------------------------
/Sample/Views/Home/Claims.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Claims";
3 | }
4 |
5 | Claims
6 |
7 | @foreach (var claim in User.Claims)
8 | {
9 | - @claim.Type - @claim.Value
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/Sample/Views/Home/Contact.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Contact";
3 | }
4 | @ViewData["Title"].
5 | @ViewData["Message"]
6 |
7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P:
11 | 425.555.0100
12 |
13 |
14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com
17 |
18 |
--------------------------------------------------------------------------------
/Sample/Views/Home/Index.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Home Page";
3 | }
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |

15 |
16 |
17 | Learn how to build ASP.NET apps that can run anywhere.
18 |
19 | Learn More
20 |
21 |
22 |
23 |
24 |
25 |

26 |
27 |
28 | There are powerful new features in Visual Studio for building modern web apps.
29 |
30 | Learn More
31 |
32 |
33 |
34 |
35 |
36 |

37 |
38 |
39 | Bring in libraries from NuGet, Bower, and npm, and automate tasks using Grunt or Gulp.
40 |
41 | Learn More
42 |
43 |
44 |
45 |
46 |
47 |

48 |
49 |
50 | Learn how Microsoft's Azure cloud platform allows you to build, deploy, and scale web apps.
51 |
52 | Learn More
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | Previous
61 |
62 |
63 |
64 | Next
65 |
66 |
67 |
68 |
69 |
70 |
Application uses
71 |
72 | - Sample pages using ASP.NET Core MVC
73 | - Bower for managing client-side libraries
74 | - Theming using Bootstrap
75 |
76 |
77 |
88 |
100 |
101 |
Run & Deploy
102 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/Sample/Views/Shared/Error.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Error";
3 | }
4 |
5 | Error.
6 | An error occurred while processing your request.
7 |
8 | Development Mode
9 |
10 | Swapping to Development environment will display more detailed information about the error that occurred.
11 |
12 |
13 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
14 |
15 |
--------------------------------------------------------------------------------
/Sample/Views/Shared/_Layout.cshtml:
--------------------------------------------------------------------------------
1 | @inject Microsoft.ApplicationInsights.AspNetCore.JavaScriptSnippet JavaScriptSnippet
2 |
3 |
4 |
5 |
6 |
7 | @ViewData["Title"] - Sample
8 |
9 |
10 |
11 |
12 |
13 |
14 |
17 |
18 |
19 | @Html.Raw(JavaScriptSnippet.FullScript)
20 |
21 |
22 |
45 |
46 | @RenderBody()
47 |
48 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
65 |
71 |
72 |
73 |
74 | @RenderSection("Scripts", required: false)
75 |
76 |
77 |
--------------------------------------------------------------------------------
/Sample/Views/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/Sample/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using Sample
2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
3 |
--------------------------------------------------------------------------------
/Sample/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/Sample/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Debug",
6 | "System": "Information",
7 | "Microsoft": "Information"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Sample/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Warning"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Sample/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "asp.net",
3 | "private": true,
4 | "dependencies": {
5 | "bootstrap": "3.3.7",
6 | "jquery": "2.2.0",
7 | "jquery-validation": "1.14.0",
8 | "jquery-validation-unobtrusive": "3.2.6"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Sample/bundleconfig.json:
--------------------------------------------------------------------------------
1 | // Configure bundling and minification for the project.
2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241
3 | [
4 | {
5 | "outputFileName": "wwwroot/css/site.min.css",
6 | // An array of relative input file paths. Globbing patterns supported
7 | "inputFiles": [
8 | "wwwroot/css/site.css"
9 | ]
10 | },
11 | {
12 | "outputFileName": "wwwroot/js/site.min.js",
13 | "inputFiles": [
14 | "wwwroot/js/site.js"
15 | ],
16 | // Optionally specify minification options
17 | "minify": {
18 | "enabled": true,
19 | "renameLocals": true
20 | },
21 | // Optionally generate .map file
22 | "sourceMap": false
23 | }
24 | ]
25 |
--------------------------------------------------------------------------------
/Sample/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 50px;
3 | padding-bottom: 20px;
4 | }
5 |
6 | /* Wrapping element */
7 | /* Set some basic padding to keep content from hitting the edges */
8 | .body-content {
9 | padding-left: 15px;
10 | padding-right: 15px;
11 | }
12 |
13 | /* Set widths on the form inputs since otherwise they're 100% wide */
14 | input,
15 | select,
16 | textarea {
17 | max-width: 280px;
18 | }
19 |
20 | /* Carousel */
21 | .carousel-caption p {
22 | font-size: 20px;
23 | line-height: 1.4;
24 | }
25 |
26 | /* Make .svg files in the carousel display properly in older browsers */
27 | .carousel-inner .item img[src$=".svg"] {
28 | width: 100%;
29 | }
30 |
31 | /* Hide/rearrange for smaller screens */
32 | @media screen and (max-width: 767px) {
33 | /* Hide captions */
34 | .carousel-caption {
35 | display: none;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Sample/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisdrobison/aspnetcore-wsfed/507c0d0cdaf6831757aec907bb750133dac7eb89/Sample/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/Sample/wwwroot/images/banner1.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Sample/wwwroot/images/banner2.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Sample/wwwroot/images/banner3.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Sample/wwwroot/images/banner4.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Sample/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Write your Javascript code.
2 |
--------------------------------------------------------------------------------