OAuth OK!
This commit is contained in:
parent
494a840f70
commit
567e4a6635
382 changed files with 52478 additions and 7572 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -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(
|
||||
|
|
|
|||
18
Yavsc/Helpers/OAuthHelpers.cs
Normal file
18
Yavsc/Helpers/OAuthHelpers.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@ using System.Net;
|
|||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Model
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Simple json post method.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue