diff --git a/omnisharp.json b/omnisharp.json
index 17454b13..ae3aca17 100644
--- a/omnisharp.json
+++ b/omnisharp.json
@@ -1,15 +1,15 @@
{
"dotnet": {
- "enabled": false
+ "enabled": true
},
"msbuild": {
"enabled": false
},
"scriptcs": {
- "enabled": false
+ "enabled": true
},
"Dnx": {
- "enabled": true,
+ "enabled": false,
"enablePackageRestore": false,
"projects": "src/*/project.json;*/project.json;project.json;test/*/project.json"
},
diff --git a/src/GoogleCode/GoogleTranslate/GoogleTranslate.cs b/src/GoogleCode/GoogleTranslate/GoogleTranslate.cs
deleted file mode 100644
index e6d33fef..00000000
--- a/src/GoogleCode/GoogleTranslate/GoogleTranslate.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using GoogleTranslateNET.Misc;
-using GoogleTranslateNET.Objects.Error;
-using GoogleTranslateNET.Objects.LanguageDetection;
-using GoogleTranslateNET.Objects.SupportedLanguages;
-using GoogleTranslateNET.Objects.Translation;
-using RestSharp;
-using RestSharp.Deserializers;
-using System.Linq;
-
-
-namespace GoogleTranslateNET
-{
- public class NoSevrerSideImplementationAttribute : Attribute
- {
- public string Reason { get ; private set; }
- public NoSevrerSideImplementationAttribute(string reason) : base()
- {
- Reason = reason;
- }
-
- }
-
- [NoSevrerSideImplementation("none")]
- public class GoogleTranslate
- {
- private string _key;
- private static RestClient _client = new RestClient("https://www.googleapis.com/language/translate/v2");
-
- public GoogleTranslate(string key)
- {
- if (string.IsNullOrEmpty(key))
- throw new ArgumentException("Key is required.", "key");
-
- _key = key;
- }
-
- ///
- /// When true, the output from google is in human readable format.
- /// Default: Not set, Google defaults to true
- ///
- public bool? PrettyPrint { get; set; }
-
- ///
- /// When true, queries will be sent using HTTP POST instead of GET.
- /// GET queries have a limit of 2000 characters, POST queries have a limit of 5000 characters.
- /// Default: Not set, Google defaults to false
- ///
- public bool? LargeQuery { get; set; }
-
- ///
- /// Translates a text from one language to another.
- /// You can input multiple texts and get them translated all at once.
- /// Warning: Setting source and destination languages to the same language will result in an error.
- ///
- /// The language to translate from. Set it to Language.Automatic to let Google Translate determine the language.
- /// The language to translate to.
- /// The text to translate. You may input more than one text.
- /// The translated text.
- public List Translate(Language sourceLanguage, Language destinationLanaguage, params string[] text)
- {
- //https://www.googleapis.com/language/translate/v2?key=key&q=hello%20world&source=en&target=de
- RestRequest request = CreateRequest(string.Empty);
-
- CheckRequest(text);
-
- //Required
- foreach (string q in text)
- {
- request.AddParameter("q", q);
- }
- request.AddParameter("target", destinationLanaguage.GetStringValue());
-
- //Optional
- if (sourceLanguage != Language.Automatic)
- request.AddParameter("source", sourceLanguage.GetStringValue());
-
- //Output
- TranslateResult results = GetResponse(request);
- return results.Data.Translations;
- }
-
- ///
- /// Gives you a list of supported languages.
- ///
- /// When defined, gives you a list of languages that translates into the target language.
- /// A list of supported languages
- public List GetSupportedLanguages(Language targetLanguage = Language.Unknown)
- {
- //https://www.googleapis.com/language/translate/v2/languages?key=key&target=zh-TW
- RestRequest request = CreateRequest("languages");
-
- //Optional
- if (targetLanguage != Language.Unknown)
- request.AddParameter("target", targetLanguage.GetStringValue());
-
- //Output
- SupportedLanguageResult results = GetResponse(request);
- return results.Data.Languages;
- }
-
- ///
- /// Detects the languages that might be used in the text.
- /// You can send more than one text in a single request to detect multiple texts.
- ///
- /// The text to use when detecting languages.
- /// A list of languages that might be used in the text.
- public List DetectLanguage(params string[] text)
- {
- //https://www.googleapis.com/language/translate/v2/detect?key=key&q=google+translate+is+fast
- RestRequest request = CreateRequest("detect");
-
- CheckRequest(text);
-
- //Required
- foreach (string q in text)
- {
- request.AddParameter("q", q);
- }
-
- //Output
- LanguageDetectionResult results = GetResponse(request);
-
- //Flatten the results from Google Translate API
- List detections = new List();
- foreach (List languageDetections in results.Data.Detections)
- {
- detections.AddRange(languageDetections);
- }
-
- return detections;
- }
-
- private void CheckRequest(IEnumerable requestContent)
- {
- //Compute the total size of the content
- int sum = requestContent.Sum(item => item.Length);
-
- if (((LargeQuery.HasValue && !LargeQuery.Value) || !LargeQuery.HasValue) && sum >= 2000)
- {
- throw new ArgumentException("Your text content is larger than 2000 characters. Set LargeQuery to 'true' to enable support up to 5000 characters.");
- }
-
- if (sum > 5000)
- throw new ArgumentException("Your text content is larger than 5000 characters. Google Translate only allow up to 5000 characters");
- }
-
- private RestRequest CreateRequest(string function)
- {
- RestRequest request;
-
- if (LargeQuery.HasValue && LargeQuery.Value)
- {
- request = new RestRequest(function, Method.POST);
-
- //To use POST, you must use the X-HTTP-Method-Override header to tell the Translate API to treat the request as a GET (use X-HTTP-Method-Override: GET).
- request.AddHeader("X-HTTP-Method-Override", "GET");
- }
- else
- {
- request = new RestRequest(function, Method.GET);
- }
-
- request.AddParameter("key", _key);
-
- if (PrettyPrint.HasValue)
- request.AddParameter("prettyprint", PrettyPrint.ToString().ToLower());
-
- return request;
- }
-
- private T GetResponse(RestRequest request)
- {
- RestResponse response = (RestResponse)_client.Execute(request);
- JsonDeserializer deserializer = new JsonDeserializer();
- T results = deserializer.Deserialize(response);
-
- //Try to deserialize it as an error - it is a hack since I'm using generics here.
- ErrorResponse errorResponse = deserializer.Deserialize(response);
-
- if (errorResponse.Error != null)
- throw new Exception(GetErrorText(errorResponse.Error));
-
- return results;
- }
-
- private string GetErrorText(Error error)
- {
- if (error != null)
- {
- StringBuilder sb = new StringBuilder();
- sb.Append(error.Message);
-
- if (error.Errors.Count >= 1)
- {
- ErrorData errorData = error.Errors.First();
- sb.Append("Reason: " + errorData.Reason);
- }
-
- return sb.ToString();
- }
-
- return "There was an error. Unable to determine the cause.";
- }
- }
-}
diff --git a/src/GoogleCode/GoogleTranslate/Language.cs b/src/GoogleCode/GoogleTranslate/Language.cs
deleted file mode 100644
index 264d3505..00000000
--- a/src/GoogleCode/GoogleTranslate/Language.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-using GoogleTranslateNET.Misc;
-
-namespace GoogleTranslateNET
-{
- public enum Language
- {
- Unknown,
- Automatic,
- [StringValue("af")]
- Afrikaans,
- [StringValue("sq")]
- Albanian,
- [StringValue("ar")]
- Arabic,
- [StringValue("be")]
- Belarusian,
- [StringValue("bg")]
- Bulgarian,
- [StringValue("ca")]
- Catalan,
- [StringValue("zh")]
- ChineseSimplified,
- [StringValue("zh-TW")]
- ChineseTraditional,
- [StringValue("hr")]
- Croatian,
- [StringValue("cs")]
- Czech,
- [StringValue("da")]
- Danish,
- [StringValue("nl")]
- Dutch,
- [StringValue("en")]
- English,
- [StringValue("eo")]
- Esperanto,
- [StringValue("et")]
- Estonian,
- [StringValue("tl")]
- Filipino,
- [StringValue("fi")]
- Finnish,
- [StringValue("fr")]
- French,
- [StringValue("gl")]
- Galician,
- [StringValue("de")]
- German,
- [StringValue("el")]
- Greek,
- [StringValue("ht")]
- HaitianCreole,
- [StringValue("iw")]
- Hebrew,
- [StringValue("hi")]
- Hindi,
- [StringValue("hu")]
- Hungarian,
- [StringValue("is")]
- Icelandic,
- [StringValue("id")]
- Indonesian,
- [StringValue("ga")]
- Irish,
- [StringValue("it")]
- Italian,
- [StringValue("ja")]
- Japanese,
- [StringValue("ko")]
- Korean,
- [StringValue("lv")]
- Latvian,
- [StringValue("lt")]
- Lithuanian,
- [StringValue("mk")]
- Macedonian,
- [StringValue("ms")]
- Malay,
- [StringValue("mt")]
- Maltese,
- [StringValue("no")]
- Norwegian,
- [StringValue("fa")]
- Persian,
- [StringValue("pl")]
- Polish,
- [StringValue("pt")]
- Portuguese,
- [StringValue("ro")]
- Romanian,
- [StringValue("ru")]
- Russian,
- [StringValue("sr")]
- Serbian,
- [StringValue("sk")]
- Slovak,
- [StringValue("sl")]
- Slovenian,
- [StringValue("es")]
- Spanish,
- [StringValue("sw")]
- Swahili,
- [StringValue("sv")]
- Swedish,
- [StringValue("th")]
- Thai,
- [StringValue("tr")]
- Turkish,
- [StringValue("uk")]
- Ukrainian,
- [StringValue("vi")]
- Vietnamese,
- [StringValue("cy")]
- Welsh,
- [StringValue("yi")]
- Yiddish
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/Misc/ExtensionMethods.cs b/src/GoogleCode/GoogleTranslate/Misc/ExtensionMethods.cs
deleted file mode 100644
index daa6203c..00000000
--- a/src/GoogleCode/GoogleTranslate/Misc/ExtensionMethods.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System;
-using System.Reflection;
-
-namespace GoogleTranslateNET.Misc
-{
- public static class ExtensionMethods
- {
- ///
- /// Will get the string value for a given enums value, this will
- /// only work if you assign the StringValue attribute to
- /// the items in your enum.
- /// Source: http://weblogs.asp.net/stefansedich/archive/2008/03/12/enum-with-string-values-in-c.aspx
- ///
- ///
- ///
- public static string GetStringValue(this Enum value)
- {
- // Get the type
- Type type = value.GetType();
-
- // Get fieldinfo for this type
- FieldInfo fieldInfo = type.GetField(value.ToString());
-
- // Get the stringvalue attributes
- StringValueAttribute[] attribs = fieldInfo.GetCustomAttributes(
- typeof(StringValueAttribute), false) as StringValueAttribute[];
-
- // Return the first if there was a match.
- return attribs.Length > 0 ? attribs[0].StringValue : null;
- }
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/Misc/StringValueAttribute.cs b/src/GoogleCode/GoogleTranslate/Misc/StringValueAttribute.cs
deleted file mode 100644
index e1c39c00..00000000
--- a/src/GoogleCode/GoogleTranslate/Misc/StringValueAttribute.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-
-namespace GoogleTranslateNET.Misc
-{
- ///
- /// This attribute is used to represent a string value
- /// for a value in an enum.
- ///
- public class StringValueAttribute : Attribute
- {
- public string StringValue { get; private set; }
-
- public StringValueAttribute(string value)
- {
- StringValue = value;
- }
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/Objects/Error/Error.cs b/src/GoogleCode/GoogleTranslate/Objects/Error/Error.cs
deleted file mode 100644
index 953dc0e5..00000000
--- a/src/GoogleCode/GoogleTranslate/Objects/Error/Error.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System.Collections.Generic;
-
-namespace GoogleTranslateNET.Objects.Error
-{
- public class Error
- {
- public int Code { get; set; }
- public string Message { get; set; }
- public List Errors { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/Objects/Error/ErrorData.cs b/src/GoogleCode/GoogleTranslate/Objects/Error/ErrorData.cs
deleted file mode 100644
index 2bafbec9..00000000
--- a/src/GoogleCode/GoogleTranslate/Objects/Error/ErrorData.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace GoogleTranslateNET.Objects.Error
-{
- public class ErrorData
- {
- public string Domain { get; set; }
- public string Reason { get; set; }
- public string Message { get; set; }
- public string LocationType { get; set; }
- public string Location { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/Objects/Error/ErrorResponse.cs b/src/GoogleCode/GoogleTranslate/Objects/Error/ErrorResponse.cs
deleted file mode 100644
index df25034f..00000000
--- a/src/GoogleCode/GoogleTranslate/Objects/Error/ErrorResponse.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace GoogleTranslateNET.Objects.Error
-{
- public class ErrorResponse
- {
- public Error Error { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/Objects/LanguageDetection/LanguageDetection.cs b/src/GoogleCode/GoogleTranslate/Objects/LanguageDetection/LanguageDetection.cs
deleted file mode 100644
index 82f094cf..00000000
--- a/src/GoogleCode/GoogleTranslate/Objects/LanguageDetection/LanguageDetection.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace GoogleTranslateNET.Objects.LanguageDetection
-{
- public class LanguageDetection
- {
- public string Language { get; set; }
- public bool IsReliable { get; set; }
- public float Confidence { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/Objects/LanguageDetection/LanguageDetectionData.cs b/src/GoogleCode/GoogleTranslate/Objects/LanguageDetection/LanguageDetectionData.cs
deleted file mode 100644
index a8a7e256..00000000
--- a/src/GoogleCode/GoogleTranslate/Objects/LanguageDetection/LanguageDetectionData.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System.Collections.Generic;
-
-namespace GoogleTranslateNET.Objects.LanguageDetection
-{
- public class LanguageDetectionData
- {
- public List> Detections { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/Objects/LanguageDetection/LanguageDetectionResult.cs b/src/GoogleCode/GoogleTranslate/Objects/LanguageDetection/LanguageDetectionResult.cs
deleted file mode 100644
index 8fa1528e..00000000
--- a/src/GoogleCode/GoogleTranslate/Objects/LanguageDetection/LanguageDetectionResult.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace GoogleTranslateNET.Objects.LanguageDetection
-{
- public class LanguageDetectionResult
- {
- public LanguageDetectionData Data { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/Objects/SupportedLanguages/SupportedLanguageData.cs b/src/GoogleCode/GoogleTranslate/Objects/SupportedLanguages/SupportedLanguageData.cs
deleted file mode 100644
index 3cf16092..00000000
--- a/src/GoogleCode/GoogleTranslate/Objects/SupportedLanguages/SupportedLanguageData.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System.Collections.Generic;
-
-namespace GoogleTranslateNET.Objects.SupportedLanguages
-{
- public class SupportedLanguageData
- {
- public List Languages { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/Objects/SupportedLanguages/SupportedLanguageResult.cs b/src/GoogleCode/GoogleTranslate/Objects/SupportedLanguages/SupportedLanguageResult.cs
deleted file mode 100644
index 165fae43..00000000
--- a/src/GoogleCode/GoogleTranslate/Objects/SupportedLanguages/SupportedLanguageResult.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace GoogleTranslateNET.Objects.SupportedLanguages
-{
- public class SupportedLanguageResult
- {
- public SupportedLanguageData Data { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/Objects/SupportedLanguages/TranslationLanaguage.cs b/src/GoogleCode/GoogleTranslate/Objects/SupportedLanguages/TranslationLanaguage.cs
deleted file mode 100644
index 5b01c8ce..00000000
--- a/src/GoogleCode/GoogleTranslate/Objects/SupportedLanguages/TranslationLanaguage.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace GoogleTranslateNET.Objects.SupportedLanguages
-{
- public class TranslationLanaguage
- {
- public string Language { get; set; }
- public string Name { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/Objects/Translation/TranslateResult.cs b/src/GoogleCode/GoogleTranslate/Objects/Translation/TranslateResult.cs
deleted file mode 100644
index 87e3803a..00000000
--- a/src/GoogleCode/GoogleTranslate/Objects/Translation/TranslateResult.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace GoogleTranslateNET.Objects.Translation
-{
- public class TranslateResult
- {
- public TranslationData Data { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/Objects/Translation/Translation.cs b/src/GoogleCode/GoogleTranslate/Objects/Translation/Translation.cs
deleted file mode 100644
index eaf47131..00000000
--- a/src/GoogleCode/GoogleTranslate/Objects/Translation/Translation.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace GoogleTranslateNET.Objects.Translation
-{
- public class Translation
- {
- public string TranslatedText { get; set; }
- public string DetectedSourceLanguage { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/Objects/Translation/TranslationData.cs b/src/GoogleCode/GoogleTranslate/Objects/Translation/TranslationData.cs
deleted file mode 100644
index 4acaf545..00000000
--- a/src/GoogleCode/GoogleTranslate/Objects/Translation/TranslationData.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System.Collections.Generic;
-
-namespace GoogleTranslateNET.Objects.Translation
-{
- public class TranslationData
- {
- public List Translations { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/GoogleCode/GoogleTranslate/project.json b/src/GoogleCode/GoogleTranslate/project.json
deleted file mode 100644
index 7d60e193..00000000
--- a/src/GoogleCode/GoogleTranslate/project.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "version": "1.0.5-*",
- "title": "Yavsc Google Translate [DNX]",
- "description": "Google Translate for DNX",
- "authors": [
- "Paul Schneider "
- ],
- "packOptions": {
- "repository": {
- "type": "git",
- "url": "https://github.com/pazof/yavsc"
- },
- "licenseUrl": "https://github.com/pazof/yavsc/blob/vnext/LICENSE",
- "requireLicenseAcceptance": true,
- "owners": [
- "Paul Schneider "
- ],
- "summary": "CSharp Google Tranlate API",
- "projectUrl": "http://yavsc.pschneider.fr",
- "tags": [
- "Translation"
- ]
- },
- "tooling": {
- "defaultNamespace": "Yavsc"
- },
- "dependencies": {
- "Newtonsoft.Json": "6.0.1-beta1",
- "Gapi.net45": "1.0.1",
- "RestSharp": "103.4.0"
- },
- "frameworks": {
- "dnx451": {
- "frameworkAssemblies": {
- "System.ComponentModel.DataAnnotations": "4.0.0"
- }
- },
- "net46": {
- "frameworkAssemblies": {
- "System.ComponentModel.DataAnnotations": "4.0.0"
- }
- },
- "net461": {
- "frameworkAssemblies": {
- "System.ComponentModel.DataAnnotations": "4.0.0"
- }
- },
- "net452": {
- "frameworkAssemblies": {
- "System.ComponentModel.DataAnnotations": "4.0.0"
- }
- },
- "net451": {
- "frameworkAssemblies": {
- "System.ComponentModel.DataAnnotations": "4.0.0"
- }
- }
- }
-}
diff --git a/src/OAuth.AspNet.AuthServer/AuthenticationResponseChallenge.cs b/src/OAuth.AspNet.AuthServer/AuthenticationResponseChallenge.cs
deleted file mode 100644
index 4cd7143d..00000000
--- a/src/OAuth.AspNet.AuthServer/AuthenticationResponseChallenge.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using Microsoft.AspNet.Http.Authentication;
-
-namespace OAuth.AspNet.AuthServer
-{
- ///
- /// Exposes the security.Challenge environment value as a strong type.
- ///
- public class AuthenticationResponseChallenge
- {
- ///
- /// Initializes a new instance of the class
- ///
- ///
- ///
- public AuthenticationResponseChallenge(string[] authenticationTypes, AuthenticationProperties properties)
- {
- AuthenticationTypes = authenticationTypes;
- Properties = properties ?? new AuthenticationProperties();
- }
-
- ///
- /// List of the authentication types that should send a challenge in the response.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "By design")]
- public string[] AuthenticationTypes { get; private set; }
-
- ///
- /// Dictionary used to store state values about the authentication session.
- ///
- public AuthenticationProperties Properties { get; private set; }
- }
-}
diff --git a/src/OAuth.AspNet.AuthServer/AuthenticationResponseGrant.cs b/src/OAuth.AspNet.AuthServer/AuthenticationResponseGrant.cs
deleted file mode 100644
index 28900a4e..00000000
--- a/src/OAuth.AspNet.AuthServer/AuthenticationResponseGrant.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-using Microsoft.AspNet.Http.Authentication;
-using System;
-using System.Linq;
-using System.Security.Claims;
-
-namespace OAuth.AspNet.AuthServer
-{
- ///
- /// Exposes the security.SignIn environment value as a strong type.
- ///
- public class AuthenticationResponseGrant
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- ///
- public AuthenticationResponseGrant(ClaimsIdentity identity, AuthenticationProperties properties)
- {
- Principal = new ClaimsPrincipal(identity);
- Identity = identity;
- Properties = properties;
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- ///
- public AuthenticationResponseGrant(ClaimsPrincipal principal, AuthenticationProperties properties)
- {
- if (principal == null)
- {
- throw new ArgumentNullException("principal");
- }
-
- Principal = principal;
- Identity = principal.Identities.FirstOrDefault();
- Properties = properties;
- }
-
- ///
- /// The identity associated with the user sign in.
- ///
- public ClaimsIdentity Identity { get; private set; }
-
- ///
- /// The security principal associated with the user sign in.
- ///
- public ClaimsPrincipal Principal { get; private set; }
-
- ///
- /// Dictionary used to store state values about the authentication session.
- ///
- public AuthenticationProperties Properties { get; private set; }
- }
-}
diff --git a/src/OAuth.AspNet.AuthServer/AuthenticationTokenCreateContext.cs b/src/OAuth.AspNet.AuthServer/AuthenticationTokenCreateContext.cs
deleted file mode 100644
index 4dda1538..00000000
--- a/src/OAuth.AspNet.AuthServer/AuthenticationTokenCreateContext.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using Microsoft.AspNet.Http;
-using Microsoft.AspNet.Authentication;
-using System;
-
-namespace OAuth.AspNet.AuthServer
-{
-
- public class AuthenticationTokenCreateContext : BaseContext
- {
- private readonly ISecureDataFormat _secureDataFormat;
-
- public AuthenticationTokenCreateContext(HttpContext context, ISecureDataFormat secureDataFormat, AuthenticationTicket ticket) : base(context)
- {
- if (secureDataFormat == null)
- throw new ArgumentNullException(nameof(secureDataFormat));
-
- if (ticket == null)
- throw new ArgumentNullException(nameof(ticket));
-
- _secureDataFormat = secureDataFormat;
-
- Ticket = ticket;
- }
-
- public string Token { get; protected set; }
-
- public AuthenticationTicket Ticket { get; protected set; }
-
- public string SerializeTicket()
- {
- return _secureDataFormat.Protect(Ticket);
- }
-
- public void SetToken(string tokenValue)
- {
- if (tokenValue == null)
- throw new ArgumentNullException(nameof(tokenValue));
-
- Token = tokenValue;
- }
- }
-
-}
diff --git a/src/OAuth.AspNet.AuthServer/AuthenticationTokenProvider.cs b/src/OAuth.AspNet.AuthServer/AuthenticationTokenProvider.cs
deleted file mode 100644
index aac9bcb7..00000000
--- a/src/OAuth.AspNet.AuthServer/AuthenticationTokenProvider.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-using System;
-using System.Threading.Tasks;
-
-namespace OAuth.AspNet.AuthServer
-{
-
- public class AuthenticationTokenProvider : IAuthenticationTokenProvider
- {
- public Action OnCreate { get; set; }
- public Func OnCreateAsync { get; set; }
- public Action OnReceive { get; set; }
- public Func OnReceiveAsync { get; set; }
-
- public virtual void Create(AuthenticationTokenCreateContext context)
- {
- if (OnCreateAsync != null && OnCreate == null)
- {
- throw new InvalidOperationException("Authentication token did not provide an OnCreate method.");
- }
- if (OnCreate != null)
- {
- OnCreate.Invoke(context);
- }
- }
-
- public virtual async Task CreateAsync(AuthenticationTokenCreateContext context)
- {
- if (OnCreateAsync != null && OnCreate == null)
- {
- throw new InvalidOperationException("Authentication token did not provide an OnCreate method.");
- }
- if (OnCreateAsync != null)
- {
- await OnCreateAsync.Invoke(context);
- }
- else
- {
- Create(context);
- }
- }
-
- public virtual void Receive(AuthenticationTokenReceiveContext context)
- {
- if (OnReceiveAsync != null && OnReceive == null)
- {
- throw new InvalidOperationException("Authentication token did not provide an OnReceive method.");
- }
-
- if (OnReceive != null)
- {
- OnReceive.Invoke(context);
- }
- }
-
- public virtual async Task ReceiveAsync(AuthenticationTokenReceiveContext context)
- {
- if (OnReceiveAsync != null && OnReceive == null)
- {
- throw new InvalidOperationException("Authentication token did not provide an OnReceive method.");
- }
- if (OnReceiveAsync != null)
- {
- await OnReceiveAsync.Invoke(context);
- }
- else
- {
- Receive(context);
- }
- }
- }
-
-}
diff --git a/src/OAuth.AspNet.AuthServer/AuthenticationTokenReceiveContext.cs b/src/OAuth.AspNet.AuthServer/AuthenticationTokenReceiveContext.cs
deleted file mode 100644
index 96b3cc0b..00000000
--- a/src/OAuth.AspNet.AuthServer/AuthenticationTokenReceiveContext.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using Microsoft.AspNet.Http;
-using Microsoft.AspNet.Authentication;
-using System;
-
-namespace OAuth.AspNet.AuthServer
-{
-
- public class AuthenticationTokenReceiveContext : BaseContext
- {
- private readonly ISecureDataFormat _secureDataFormat;
-
- public AuthenticationTokenReceiveContext(HttpContext context, ISecureDataFormat secureDataFormat, string token) : base(context)
- {
- if (secureDataFormat == null)
- throw new ArgumentNullException(nameof(secureDataFormat));
-
- if (token == null)
- throw new ArgumentNullException(nameof(token));
-
- _secureDataFormat = secureDataFormat;
-
- Token = token;
- }
-
- public string Token { get; protected set; }
-
- public AuthenticationTicket Ticket { get; protected set; }
-
- public void DeserializeTicket(string protectedData)
- {
- Ticket = _secureDataFormat.Unprotect(protectedData);
- }
-
- public void SetTicket(AuthenticationTicket ticket)
- {
- if (ticket == null)
- throw new ArgumentNullException(nameof(ticket));
-
- Ticket = ticket;
- }
- }
-
-}
diff --git a/src/OAuth.AspNet.AuthServer/AuthorizeEndpointRequest.cs b/src/OAuth.AspNet.AuthServer/AuthorizeEndpointRequest.cs
deleted file mode 100644
index ee604b40..00000000
--- a/src/OAuth.AspNet.AuthServer/AuthorizeEndpointRequest.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-using Microsoft.AspNet.Http;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-
-namespace OAuth.AspNet.AuthServer
-{
-
- ///
- /// Data object representing the information contained in the query string of an Authorize endpoint request.
- ///
- public class AuthorizeEndpointRequest
- {
- ///
- /// Creates a new instance populated with values from the query string parameters.
- ///
- /// Query string parameters from a request.
- public AuthorizeEndpointRequest(IReadableStringCollection parameters)
- {
- if (parameters == null)
- {
- throw new ArgumentNullException("parameters");
- }
-
- Scope = new List();
-
- foreach (var parameter in parameters)
- {
- AddParameter(parameter.Key, parameters[parameter.Key]);
- }
- }
-
- ///
- /// The "response_type" query string parameter of the Authorize request. Known values are "code" and "token".
- ///
- public string ResponseType { get; set; }
-
- ///
- /// The "response_mode" query string parameter of the Authorize request. Known values are "query", "fragment" and "form_post"
- /// See also, http://openid.net/specs/oauth-v2-form-post-response-mode-1_0.html
- ///
- public string ResponseMode { get; set; }
-
- ///
- /// The "client_id" query string parameter of the Authorize request.
- ///
- public string ClientId { get; set; }
-
- ///
- /// The "redirect_uri" query string parameter of the Authorize request. May be absent if the server should use the
- /// redirect uri known to be registered to the client id.
- ///
- [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings", Justification = "By design")]
- public string RedirectUri { get; set; }
-
- ///
- /// The "scope" query string parameter of the Authorize request. May be absent if the server should use default scopes.
- ///
- public IList Scope { get; private set; }
-
- ///
- /// The "scope" query string parameter of the Authorize request. May be absent if the client does not require state to be
- /// included when returning to the RedirectUri.
- ///
- public string State { get; set; }
-
- ///
- /// True if the "response_type" query string parameter is "code".
- /// See also, http://tools.ietf.org/html/rfc6749#section-4.1.1
- ///
- public bool IsAuthorizationCodeGrantType
- {
- get { return ContainsGrantType(Constants.ResponseTypes.Code); }
- }
-
- ///
- /// True if the "response_type" query string parameter is "token".
- /// See also, http://tools.ietf.org/html/rfc6749#section-4.2.1
- ///
- public bool IsImplicitGrantType
- {
- get { return ContainsGrantType(Constants.ResponseTypes.Token); }
- }
-
- public bool IsFormPostResponseMode
- {
- get { return string.Equals(ResponseMode, Constants.ResponseModes.FormPost, StringComparison.Ordinal); }
- }
-
- ///
- /// True if the "response_type" query string contains the passed responseType.
- /// See also, http://openid.net/specs/oauth-v2-multiple-response-types-1_0.html
- ///
- /// The responseType that is expected within the "response_type" query string
- /// True if the "response_type" query string contains the passed responseType.
- public bool ContainsGrantType(string responseType)
- {
- var parts = ResponseType.Split(' ');
- foreach (var part in parts)
- {
- if (string.Equals(part, responseType, StringComparison.Ordinal))
- {
- return true;
- }
- }
- return false;
- }
-
- private void AddParameter(string name, string value)
- {
- if (string.Equals(name, Constants.Parameters.ResponseType, StringComparison.Ordinal))
- {
- ResponseType = value;
- }
- else if (string.Equals(name, Constants.Parameters.ClientId, StringComparison.Ordinal))
- {
- ClientId = value;
- }
- else if (string.Equals(name, Constants.Parameters.RedirectUri, StringComparison.Ordinal))
- {
- RedirectUri = value;
- }
- else if (string.Equals(name, Constants.Parameters.Scope, StringComparison.Ordinal))
- {
- Scope = value.Split(' ');
- }
- else if (string.Equals(name, Constants.Parameters.State, StringComparison.Ordinal))
- {
- State = value;
- }
- else if (string.Equals(name, Constants.Parameters.ResponseMode, StringComparison.Ordinal))
- {
- ResponseMode = value;
- }
- }
- }
-
-}
diff --git a/src/OAuth.AspNet.AuthServer/BaseOAuthEndpointContext.cs b/src/OAuth.AspNet.AuthServer/BaseOAuthEndpointContext.cs
deleted file mode 100644
index 17099070..00000000
--- a/src/OAuth.AspNet.AuthServer/BaseOAuthEndpointContext.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using Microsoft.AspNet.Authentication;
-using Microsoft.AspNet.Http;
-using System;
-
-namespace OAuth.AspNet.AuthServer
-{
-
- ///
- /// Base class for OAuth server endpoint contexts
- ///
- public class BaseOAuthEndpointContext : BaseContext
- {
- #region Constructors
-
- ///
- /// Creates a new instance of .
- ///
- /// The to use for this endpoint context.
- /// The to use for this endpoint context.
- public BaseOAuthEndpointContext(HttpContext context, OAuthAuthorizationServerOptions options) : base(context)
- {
- if (options == null)
- throw new ArgumentNullException(nameof(options));
-
- Options = options;
- }
-
- #endregion
-
- #region Public Members
-
- ///
- /// Gets the OAuth server options.
- ///
- public OAuthAuthorizationServerOptions Options { get; }
-
- #endregion
- }
-
-}
diff --git a/src/OAuth.AspNet.AuthServer/BaseValidatingClientContext.cs b/src/OAuth.AspNet.AuthServer/BaseValidatingClientContext.cs
deleted file mode 100644
index d2df770b..00000000
--- a/src/OAuth.AspNet.AuthServer/BaseValidatingClientContext.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using Microsoft.AspNet.Http;
-
-namespace OAuth.AspNet.AuthServer
-{
-
- ///
- /// Base class used for certain event contexts
- ///
- public abstract class BaseValidatingClientContext : BaseValidatingContext
- {
- ///
- /// Initializes base class used for certain event contexts
- ///
- protected BaseValidatingClientContext(HttpContext context, OAuthAuthorizationServerOptions options, string clientId) : base(context, options)
- {
- ClientId = clientId;
- }
-
- ///
- /// The "client_id" parameter for the current request. The Authorization Server application is responsible for
- /// validating this value identifies a registered client.
- ///
- public string ClientId { get; protected set; }
- }
-
-}
diff --git a/src/OAuth.AspNet.AuthServer/BaseValidatingContext.cs b/src/OAuth.AspNet.AuthServer/BaseValidatingContext.cs
deleted file mode 100644
index 6252bc17..00000000
--- a/src/OAuth.AspNet.AuthServer/BaseValidatingContext.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-using Microsoft.AspNet.Authentication;
-using Microsoft.AspNet.Http;
-
-namespace OAuth.AspNet.AuthServer
-{
-
- ///
- /// Base class used for certain event contexts
- ///
- public abstract class BaseValidatingContext : BaseContext
- {
- ///
- /// Initializes base class used for certain event contexts
- ///
- protected BaseValidatingContext(HttpContext context, TOptions options) : base(context)
- {
- Options = options;
- }
-
- ///
- /// The context options.
- ///
- public TOptions Options { get; private set; }
-
- ///
- /// True if application code has called any of the Validate methods on this context.
- ///
- public bool IsValidated { get; private set; }
-
- ///
- /// True if application code has called any of the SetError methods on this context.
- ///
- public bool HasError { get; private set; }
-
- ///
- /// The error argument provided when SetError was called on this context. This is eventually
- /// returned to the client app as the OAuth "error" parameter.
- ///
- public string Error { get; private set; }
-
- ///
- /// The optional errorDescription argument provided when SetError was called on this context. This is eventually
- /// returned to the client app as the OAuth "error_description" parameter.
- ///
- public string ErrorDescription { get; private set; }
-
- ///
- /// The optional errorUri argument provided when SetError was called on this context. This is eventually
- /// returned to the client app as the OAuth "error_uri" parameter.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings", Justification = "error_uri is a string value in the protocol")]
- public string ErrorUri { get; private set; }
-
- ///
- /// Marks this context as validated by the application. IsValidated becomes true and HasError becomes false as a result of calling.
- ///
- /// True if the validation has taken effect.
- public virtual bool Validated()
- {
- IsValidated = true;
- HasError = false;
- return true;
- }
-
- ///
- /// Marks this context as not validated by the application. IsValidated and HasError become false as a result of calling.
- ///
- public virtual void Rejected()
- {
- IsValidated = false;
- HasError = false;
- }
-
- ///
- /// Marks this context as not validated by the application and assigns various error information properties.
- /// HasError becomes true and IsValidated becomes false as a result of calling.
- ///
- /// Assigned to the Error property
- public void SetError(string error)
- {
- SetError(error, null);
- }
-
- ///
- /// Marks this context as not validated by the application and assigns various error information properties.
- /// HasError becomes true and IsValidated becomes false as a result of calling.
- ///
- /// Assigned to the Error property
- /// Assigned to the ErrorDescription property
- public void SetError(string error, string errorDescription)
- {
- SetError(error, errorDescription, null);
- }
-
- ///
- /// Marks this context as not validated by the application and assigns various error information properties.
- /// HasError becomes true and IsValidated becomes false as a result of calling.
- ///
- /// Assigned to the Error property
- /// Assigned to the ErrorDescription property
- /// Assigned to the ErrorUri property
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "2#", Justification = "error_uri is a string value in the protocol")]
- public void SetError(string error, string errorDescription, string errorUri)
- {
- Error = error;
- ErrorDescription = errorDescription;
- ErrorUri = errorUri;
- Rejected();
- HasError = true;
- }
- }
-
-}
diff --git a/src/OAuth.AspNet.AuthServer/BaseValidatingTicketContext.cs b/src/OAuth.AspNet.AuthServer/BaseValidatingTicketContext.cs
deleted file mode 100644
index c0697112..00000000
--- a/src/OAuth.AspNet.AuthServer/BaseValidatingTicketContext.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using Microsoft.AspNet.Authentication;
-using Microsoft.AspNet.Http;
-using Microsoft.AspNet.Http.Authentication;
-using System.Security.Claims;
-
-namespace OAuth.AspNet.AuthServer
-{
-
- ///
- /// Base class used for certain event contexts
- ///
- public abstract class BaseValidatingTicketContext : BaseValidatingContext where TOptions : AuthenticationOptions
- {
- ///
- /// Initializes base class used for certain event contexts
- ///
- protected BaseValidatingTicketContext(HttpContext context, TOptions options, AuthenticationTicket ticket) : base(context, options)
- {
- Ticket = ticket;
- }
-
- ///
- /// Contains the identity and properties for the application to authenticate. If the Validated method
- /// is invoked with an AuthenticationTicket or ClaimsIdentity argument, that new value is assigned to
- /// this property in addition to changing IsValidated to true.
- ///
- public AuthenticationTicket Ticket { get; private set; }
-
- ///
- /// Replaces the ticket information on this context and marks it as as validated by the application.
- /// IsValidated becomes true and HasError becomes false as a result of calling.
- ///
- /// Assigned to the Ticket property
- /// True if the validation has taken effect.
- public bool Validated(AuthenticationTicket ticket)
- {
- Ticket = ticket;
- return Validated();
- }
-
- ///
- /// Alters the ticket information on this context and marks it as as validated by the application.
- /// IsValidated becomes true and HasError becomes false as a result of calling.
- ///
- /// Assigned to the Ticket.Identity property
- /// True if the validation has taken effect.
- public bool Validated(ClaimsPrincipal principal)
- {
- AuthenticationProperties properties = Ticket != null ? Ticket.Properties : new AuthenticationProperties();
- return Validated(new AuthenticationTicket(principal, properties, Options.AuthenticationScheme));
- }
- }
-
-}
diff --git a/src/OAuth.AspNet.AuthServer/DefaultBehavior.cs b/src/OAuth.AspNet.AuthServer/DefaultBehavior.cs
deleted file mode 100644
index 9a32a2f8..00000000
--- a/src/OAuth.AspNet.AuthServer/DefaultBehavior.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-using System.Threading.Tasks;
-
-namespace OAuth.AspNet.AuthServer
-{
-
- internal static class DefaultBehavior
- {
- internal static readonly Func ValidateAuthorizeRequest = context =>
- {
- context.Validated();
- return Task.FromResult