This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jim Crowley
committed
Mar 14, 2016
1 parent
4a93b39
commit 31a34ab
Showing
67 changed files
with
28,585 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.24720.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft-Graph-ExcelRest-ToDo", "Microsoft-Graph-ExcelRest-ToDo\Microsoft-Graph-ExcelRest-ToDo.csproj", "{7E86C505-414C-4D01-8DC3-940DCEEFD956}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{7E86C505-414C-4D01-8DC3-940DCEEFD956}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{7E86C505-414C-4D01-8DC3-940DCEEFD956}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{7E86C505-414C-4D01-8DC3-940DCEEFD956}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{7E86C505-414C-4D01-8DC3-940DCEEFD956}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Web; | ||
using System.Web.Optimization; | ||
|
||
namespace Microsoft_Graph_ExcelRest_ToDo | ||
{ | ||
public class BundleConfig | ||
{ | ||
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 | ||
public static void RegisterBundles(BundleCollection bundles) | ||
{ | ||
bundles.Add(new ScriptBundle("~/bundles/jquery").Include( | ||
"~/Scripts/jquery-{version}.js")); | ||
|
||
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( | ||
"~/Scripts/jquery.validate*")); | ||
|
||
// Use the development version of Modernizr to develop with and learn from. Then, when you're | ||
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need. | ||
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( | ||
"~/Scripts/modernizr-*")); | ||
|
||
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( | ||
"~/Scripts/bootstrap.js", | ||
"~/Scripts/respond.js")); | ||
|
||
bundles.Add(new StyleBundle("~/Content/css").Include( | ||
"~/Content/bootstrap.css", | ||
"~/Content/site.css")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Web; | ||
using System.Web.Mvc; | ||
|
||
namespace Microsoft_Graph_ExcelRest_ToDo | ||
{ | ||
public class FilterConfig | ||
{ | ||
public static void RegisterGlobalFilters(GlobalFilterCollection filters) | ||
{ | ||
filters.Add(new HandleErrorAttribute()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Web.Mvc; | ||
using System.Web.Routing; | ||
|
||
namespace Microsoft_Graph_ExcelRest_ToDo | ||
{ | ||
public class RouteConfig | ||
{ | ||
public static void RegisterRoutes(RouteCollection routes) | ||
{ | ||
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | ||
|
||
routes.MapRoute( | ||
name: "Default", | ||
url: "{controller}/{action}/{id}", | ||
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } | ||
); | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System.Threading.Tasks; | ||
using System.Web; | ||
using Microsoft_Graph_ExcelRest_ToDo.TokenStorage; | ||
using Microsoft.IdentityModel.Clients.ActiveDirectory; | ||
using Microsoft.Owin.Security; | ||
using Microsoft.Owin.Security.OpenIdConnect; | ||
|
||
namespace Microsoft_Graph_ExcelRest_ToDo.Auth | ||
{ | ||
public class AuthHelper | ||
{ | ||
// This is the logon authority | ||
// i.e. https://login.microsoftonline.com/common | ||
public string Authority { get; set; } | ||
// This is the application ID obtained from registering at | ||
// https://apps.dev.microsoft.com | ||
public string AppId { get; set; } | ||
// This is the application secret obtained from registering at | ||
// https://apps.dev.microsoft.com | ||
public string AppSecret { get; set; } | ||
// This is the token cache | ||
public SessionTokenCache TokenCache { get; set; } | ||
|
||
public AuthHelper(string authority, string appId, string appSecret, SessionTokenCache tokenCache) | ||
{ | ||
Authority = authority; | ||
AppId = appId; | ||
AppSecret = appSecret; | ||
TokenCache = tokenCache; | ||
} | ||
|
||
public async Task<string> GetUserAccessToken(string redirectUri) | ||
{ | ||
AuthenticationContext authContext = new AuthenticationContext(Authority, false, TokenCache); | ||
|
||
ClientCredential credential = new ClientCredential(AppId, AppSecret); | ||
|
||
try | ||
{ | ||
AuthenticationResult authResult = await authContext.AcquireTokenSilentAsync("https://graph.microsoft.com", credential, | ||
new UserIdentifier(TokenCache.UserObjectId, UserIdentifierType.UniqueId)); | ||
return authResult.AccessToken; | ||
} | ||
catch (AdalSilentTokenAcquisitionException) | ||
{ | ||
HttpContext.Current.Request.GetOwinContext().Authentication.Challenge( | ||
new AuthenticationProperties() { RedirectUri = redirectUri }, | ||
OpenIdConnectAuthenticationDefaults.AuthenticationType); | ||
|
||
return null; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
body { | ||
padding-top: 50px; | ||
padding-bottom: 20px; | ||
} | ||
|
||
/* Set padding to keep content from hitting the edges */ | ||
.body-content { | ||
padding-left: 15px; | ||
padding-right: 15px; | ||
} | ||
|
||
/* Override the default bootstrap behavior where horizontal description lists | ||
will truncate terms that are too long to fit in the left column | ||
*/ | ||
.dl-horizontal dt { | ||
white-space: normal; | ||
} |
Oops, something went wrong.