Skip to content

Commit

Permalink
Moved to new repository
Browse files Browse the repository at this point in the history
  • Loading branch information
ezet committed May 10, 2016
1 parent db34fd0 commit b40075e
Show file tree
Hide file tree
Showing 14 changed files with 636 additions and 674 deletions.
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
27 changes: 27 additions & 0 deletions EveAuthUtility.Dnx/EveAuthUtility.Dnx.xproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>95cc6839-259e-42fd-9350-5961838baf49</ProjectGuid>
<RootNamespace>eZet.EveAuthUtility</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<ProduceOutputsOnBuild>False</ProduceOutputsOnBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<ProduceOutputsOnBuild>True</ProduceOutputsOnBuild>
</PropertyGroup>
<ItemGroup>
<DnxInvisibleContent Include="EveAuthUtilityExe.project.json" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
72 changes: 72 additions & 0 deletions EveAuthUtility.Dnx/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using System;
using eZet.EveLib.EveAuthModule;

namespace ezet.EveAuthUtility {
public class EveAuthUtility {

public static EveAuth Auth = new EveAuth();

[STAThread]
public static void Main(string[] args) {
Console.WriteLine("Simple tool for obtaining access and refresh tokens from the Eve Online SSO.");
Console.WriteLine("No information is stored, some data is exchanged with the eve login servers.");
Console.WriteLine("The sourcecode is available here: https://github.com/ezet/evelib");
Console.WriteLine("You need to register an application at https://developers.eveonline.com, \nthe callback URL can be set to '/'.");
Console.WriteLine("Make sure you enable CREST and add the publicData scope for your application!\n");
Console.WriteLine("Your client ID and secret key will be provided by \nhttps://developers.eveonline.com after registering an application.\n");

Console.WriteLine("For easier editing, rightclick the title bar for the console window, \nthen go to Properties -> Options -> enable QuickEdit mode.\n");
Console.Write("Please select SSO server: (1) Tranquility or (2) Singularity: ");
var server = Console.ReadLine();
if (server == "2") Auth.Host = "sisilogin.testeveonline.com";
Console.WriteLine("Enter your client ID: ");
var clientId = "46daa2b378bd4bc189df4c3a73af226a"; // TRANQ
clientId = Console.ReadLine();
// var clientId = "cefe601d9f5a444183f8c732676709fb"; // SISI
Console.WriteLine("Enter your secret key: ");
var secret = Console.ReadLine();
//secret = "Gwg3JNT8V0DLZwb7ZmRke9zJDYp1ePnUm9V5zvjY"; // SISI
//secret = "K8GcWADljgnLZyrKGFfiqzHVvViGhapOYSCEy83h"; // TRANQ
var encodedKey = EveAuth.Encode(clientId, secret);
Console.WriteLine("Please enter your request scopes as a space delimited string, or leave empty for default scopes: ");
var scopes = "publicData characterFittingsRead characterFittingsWrite characterContactsRead characterContactsWrite characterLocationRead characterNavigationWrite";
var newScopes = Console.ReadLine();
if (!string.IsNullOrEmpty(newScopes)) scopes = newScopes;
var authLink = Auth.CreateAuthLink(clientId, "/", "default", scopes);
System.Windows.Forms.Clipboard.SetText(authLink);
Console.WriteLine("Please log in using the following link (already copied to your clipboard): ");
Console.WriteLine(authLink);
Console.WriteLine("After logging in, copy the full URL from your browser.");
Console.WriteLine("Enter the full URL: ");
string url = Console.ReadLine();
string authCode = "";
try {
int start = url.IndexOf("?code=", System.StringComparison.Ordinal);
int end = url.IndexOf("&state", System.StringComparison.Ordinal);
authCode = url.Substring(start + 6, end - start - 6);
}
catch (Exception) {
Console.WriteLine("Unable to locate authentication code, please try again.");
Console.ReadKey();
return;
}
Console.WriteLine("Authentication code found: " + authCode);
Console.WriteLine("Authenticating...");
AuthResponse response;
try {
response = Auth.AuthenticateAsync(encodedKey, authCode).Result;
}
catch (Exception e) {
Console.WriteLine("Authentication unsuccessfull, please try again.");
Console.WriteLine(e.Message);
Console.ReadLine();
return;
}
Console.WriteLine("Authentication successfull!");
Console.WriteLine("\nAccess token:\n" + response.AccessToken);
Console.WriteLine("\nRefresh token:\n" + response.RefreshToken);
Console.WriteLine("\nEncoded key:\n" + encodedKey);
Console.ReadLine();
}
}
}
36 changes: 36 additions & 0 deletions EveAuthUtility.Dnx/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("EveAuthUtilityExe")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EveAuthUtilityExe")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0aba9210-1719-4758-bc36-79f87663e8b6")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
37 changes: 37 additions & 0 deletions EveAuthUtility.Dnx/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": "1.0.2-rc1",
"description": "Simple CLI utility to assist in acquiring and managing Eve Online SSO tokens.",
"authors": [
"Lars Kristian Dahl"
],
"tags": [
"Eve Online",
"EveLib",
"EveAuthUtility",
"API",
"SSO",
"EveOnline",
"Eve",
"Online",
"CREST"
],
"projectUrl": "https://github.com/ezet/evelib",
"licenseUrl": "https://raw.githubusercontent.com/ezet/evelib/master/LICENSE",
"compilationOptions": {
"emitEntryPoint": true,
"warningsAsErrors": true
},
"dependencies": {
"eZet.EveLib.EveAuth": "3.0.1"
},
"commands": {
"EveAuthUtility": "EveAuthUtility"
},
"frameworks": {
"dnx45": {
"frameworkAssemblies": {
"System.Windows.Forms": "4.0.0.0"
}
}
}
}
14 changes: 14 additions & 0 deletions EveAuthUtility.Exe/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
61 changes: 61 additions & 0 deletions EveAuthUtility.Exe/EveAuthUtility.Exe.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9D15BE91-B09F-4549-AD03-64B6404A2BCE}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>EveAuthUtility.Exe</RootNamespace>
<AssemblyName>EveAuthUtility.Exe</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\EveAuthUtility.Dnx\Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="project.json" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
12 changes: 12 additions & 0 deletions EveAuthUtility.Exe/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EveAuthUtility.Exe {
class Program {
static void Main(string[] args) {
}
}
}
36 changes: 36 additions & 0 deletions EveAuthUtility.Exe/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("EveAuthUtility.Exe")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EveAuthUtility.Exe")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9d15be91-b09f-4549-ad03-64b6404a2bce")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Loading

0 comments on commit b40075e

Please sign in to comment.