OAuth OK!

This commit is contained in:
Paul Schneider 2016-06-12 01:32:51 +02:00
commit 567e4a6635
382 changed files with 52478 additions and 7572 deletions

View file

@ -4,7 +4,7 @@ using System.Collections.Generic;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Authentication;
namespace Yavsc.Extensions {
namespace Yavsc.Helpers {
public static class HttpContextExtensions {
public static IEnumerable<AuthenticationDescription> GetExternalProviders(this HttpContext context) {
if (context == null) {
@ -26,4 +26,6 @@ namespace Yavsc.Extensions {
select description).Any();
}
}
}

View file

@ -4,7 +4,7 @@ using System.Linq;
using Microsoft.AspNet.Mvc.Rendering;
using Yavsc.Models;
namespace Yavsc {
namespace Yavsc.Helpers {
public static class ListItemHelpers {
public static List<SelectListItem> ActivityItems(

View file

@ -0,0 +1,18 @@
using System;
using System.Security.Cryptography;
namespace Yavsc.Helpers {
public class Helper
{
public static string GetHash(string input)
{
HashAlgorithm hashAlgorithm = new SHA256CryptoServiceProvider();
byte[] byteValue = System.Text.Encoding.UTF8.GetBytes(input);
byte[] byteHash = hashAlgorithm.ComputeHash(byteValue);
return Convert.ToBase64String(byteHash);
}
}
}

View file

@ -23,7 +23,7 @@ using System.Net;
using System.IO;
using Newtonsoft.Json;
namespace Yavsc.Model
namespace Yavsc.Helpers
{
/// <summary>
/// Simple json post method.