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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using Newtonsoft.Json; | |
namespace TasksWeb.Models { | |
public class SpTaskJsonCollection { | |
[JsonProperty(PropertyName = "d")] | |
public DataCollectionReponse Data { get; set; } |
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
var spTaskJsonResponse = JsonConvert.DeserializeObject<SpTaskJsonCollection>(responseString); | |
List<SpTask> tasks = new List<SpTask>(); | |
foreach (var spListitem in spTaskJsonResponse.Data.Results) { | |
SpTask task = new SpTask { | |
Id = spListitem.Id.ToString(), | |
Title = spListitem.Title, | |
Status = spListitem.Status, | |
Priority = spListitem.Priority | |
}; |
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
using System; | |
using System.ComponentModel.DataAnnotations; | |
namespace SampleMvcAzAuth.Models { | |
public class PerUserWebCache { | |
[Key] | |
public int EntryId { get; set; } | |
public string WebUserUniqueId { get; set; } | |
public byte[] CacheBits { get; set; } | |
public DateTime LastWrite { get; set; } |
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
using System.Data.Entity; | |
using System.Data.Entity.ModelConfiguration.Conventions; | |
using SampleMvcAzAuth.Models; | |
namespace SampleMvcAzAuth.Data { | |
public class TokenCacheDataContext : DbContext{ | |
public TokenCacheDataContext() | |
: base("TokenCacheDataContext") { } | |
public DbSet<PerUserWebCache> PerUserCacheList { get; set; } |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
namespace SampleMvcAzAuth.Data { | |
public class TokenCacheInitializer : System.Data.Entity.DropCreateDatabaseIfModelChanges<TokenCacheDataContext> | |
{ | |
} | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.Linq; | |
using System.Web; | |
namespace SampleMvcAzAuth.Utils { | |
public class SettingsHelper { | |
public static string ClientId { | |
get { return ConfigurationManager.AppSettings["ida:ClientID"]; } |
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
using System; | |
using System.Collections.Generic; | |
using System.Data.Entity; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Caching; | |
using Microsoft.IdentityModel.Clients.ActiveDirectory; | |
using SampleMvcAzAuth.Data; | |
using SampleMvcAzAuth.Models; |
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
using Microsoft.Owin; | |
using Owin; | |
[assembly: OwinStartup(typeof(SampleMvcAzAuth.Startup))] | |
namespace SampleMvcAzAuth { | |
public partial class Startup { | |
public void Configuration(IAppBuilder app) | |
{ | |
ConfigureAuth(app); |
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
using System; | |
using System.Threading.Tasks; | |
using System.Web; | |
using Microsoft.IdentityModel.Clients.ActiveDirectory; | |
using Microsoft.Owin.Security; | |
using Microsoft.Owin.Security.Cookies; | |
using Microsoft.Owin.Security.OpenIdConnect; | |
using Owin; | |
using SampleMvcAzAuth.Utils; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Security.Claims; | |
using System.Web; | |
using System.Web.Mvc; | |
using Microsoft.IdentityModel.Clients.ActiveDirectory; | |
using Microsoft.Owin.Security; | |
using Microsoft.Owin.Security.Cookies; | |
using Microsoft.Owin.Security.OpenIdConnect; |