Giter Site home page Giter Site logo

igeligel / skadisteam.login Goto Github PK

View Code? Open in Web Editor NEW
8.0 4.0 3.0 91 KB

:snowflake: A package to login into steamcommunity.com via a .net core wrapper. This will not need an api key because it is using the methods which steam is providing via the web.

Home Page: https://steamcommunity.com/login/home/?goto=0

License: MIT License

C# 98.50% PowerShell 1.50%
steam steam-community wrapper steam-api steambot

skadisteam.login's Introduction

skadisteam.login

A library to login into steamcommunity.com via a .net core wrapper. This will not need an api key because it is using the methods which steam is providing via the web.

Dependencies

  • "NETStandard.Library": "1.6.0"
  • Newtonsoft.Json 9.0.1
  • System.Security.Cryptography.Csp

Installation

  1. Make sure you have .net core installed. Head over to dot.net to install .net core.

Via a nuget package

Work in progress

Via class library

  1. Clone the repo by using git or download it as .zip.
  2. In your new project add the project to the global.json file like this:
{
   "projects": [ "src", "test", "../skadisteamlogin/src" ],
   "sdk": {
     "version": "1.0.0-preview2-003121"
   }
}
"../skadisteamlogin/src"

is the path to the project.

  1. Add the reference to your project.json like this:
{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.0"
    },
    "skadisteam.login": "1.0.0-beta"
  }
}

How to use

At first you need to create the login data. The library will provide a model for this. You can create an instance like this:

var skadiLoginData = new SkadiLoginData {
    Username = "username",
    Password = "password",
    SharedSecret = "sharedSecret"
};

After this we need to instantiate the login by:

var skadiLogin = new SkadiLogin();

You can also use skadi configuration for adding extra features.

SkadiLoginConfiguration skadiLoginConfiguration = new SkadiLoginConfiguration
{
    StopOnError = false,
    WaitTimeEachError = 20
};

This needs to be appended to the login instance. This is done by:

var skadiLogin = new SkadiLogin(skadiLoginConfiguration);

After instantiating you can execute the login by applying the data to a method.

var skadiLoginResponse = skadiLogin.Execute(skadiLoginData);

The response will have several informations and the cookie container of the login. The object will have the following properties:

Parameter Type Description Example
SessionId string Id of the session "wdIaDW21adsAh"
SkadiLoginCookies CookieContainer CookieContainer which contains the cookies of the login {System.Net.CookieContainer}
SkadiLoginError SkadiLoginError If an error occurs this will be an instance of SkadiLoginError. See the documentation of it for more information null
SteamCommunityId long Steam Community Id of the account which logged in 76561198028630048
SteamCountry string Country provided by Steam DE...
SteamLanguage string Language which is set. Default is english. "english"
SteamLogin string Steam login cookie value. "76561198028630048AWd12km8d_dwaknN21..."
SteamRememberLogin string Steam's value of the cookie to remember login "76561198028630048AWd12km8d_dwaknN21..."

License

MIT License

How to grab documentation

Work in progress

Contributing

Commits

For commits i am using this style. You should also use this style when you are creating pull requests.

Csharp

For general language advice i suggest the official style guideline. Written down in markdown syntax here.

Authors

Contact information

Steam Steam

Discord Discord

Twitter Twitter

History

Date Version Description
06/30/16 -/- Start of the project

skadisteam.login's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

skadisteam.login's Issues

Session normalization

Should we explicitly set the default language to english?

session.Cookies.Add(new Cookie("Steam_Language", "english"));

Does Steam remember languages on a per-user basis or based on IP location?

Password Encryption on Linux

Password Encryption is not working on Linux.
Checkout EncryptPasswordFactory to resolve this issue.

When running the tests i get this error:

System.PlatformNotSupportedException

Stacktrace:

Stack Trace:
           at System.Security.Cryptography.RSACryptoServiceProvider..ctor()
        /home/kevin/programming/github/skadisteam.login/src/skadisteam.login/Factories/EncryptPasswordFactory.cs(23,0): at skadisteam.login.Factories.EncryptPasswordFactory.EncryptPassword(EncryptPasswordModel encryptPasswordModel)
        /home/kevin/programming/github/skadisteam.login/src/skadisteam.login/Factories/EncryptPasswordFactory.cs(18,0): at skadisteam.login.Factories.EncryptPasswordFactory.Create(GetRsaKeyResponse getRsaKeyResponse, String password)
        /home/kevin/programming/github/skadisteam.login/src/skadisteam.login.test/Factories/EncryptPasswordTest.cs(29,0): at skadisteam.login.test.Factories.EncryptPasswordTest.Length()

Other stacktrace:

skadisteam.login.test.Factories.EncryptPasswordTest.Format [FAIL]
      System.PlatformNotSupportedException : Operation is not supported on this platform.
      Stack Trace:
           at System.Security.Cryptography.RSACryptoServiceProvider..ctor()
        /home/kevin/programming/github/skadisteam.login/src/skadisteam.login/Factories/EncryptPasswordFactory.cs(23,0): at skadisteam.login.Factories.EncryptPasswordFactory.EncryptPassword(EncryptPasswordModel encryptPasswordModel)
        /home/kevin/programming/github/skadisteam.login/src/skadisteam.login/Factories/EncryptPasswordFactory.cs(18,0): at skadisteam.login.Factories.EncryptPasswordFactory.Create(GetRsaKeyResponse getRsaKeyResponse, String password)
        /home/kevin/programming/github/skadisteam.login/src/skadisteam.login.test/Factories/EncryptPasswordTest.cs(17,0): at skadisteam.login.test.Factories.EncryptPasswordTest.Format()
  Finished:    skadisteam.login.test

Possible solution described here:

Test System:

  • Ubuntu 16.04
  • .netcore 1.1.0
  • netstandard 1.6

Steam Two Factor Code

Check if the Code is transmitted in lowercase/uppercase in requests. Probably some steam related error.

SteamId Parse

In SkadiLoginResponseFactory the id is required to be a long. If the id is a custom url we should rather get the SteamID out of a cookie rather than doing one extra request then.

Refactor DoLoginResponseValidator

Code could be easily refactored in this method to a single return statement. Example can be found here.

if (doLoginResponse.Success && doLoginResponse.LoginComplete)
{
    return true;
}
return false;

Can be resolved to:

return (doLoginResponse.Success && doLoginResponse.LoginComplete);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.