seraphx2 / ESI.NET

A C# wrapper for the Eve Online ESI API.
https://www.nuget.org/packages/ESI.NET/
MIT License
42 stars 25 forks source link

Adds support for OAuth 2.0 #25

Closed samuelgrant closed 4 years ago

samuelgrant commented 5 years ago

Adds support for Oauth 2.0. To use v2 set AuthVersion.v2 in the configuration.

See: https://github.com/seraphx2/ESI.NET/issues/23#issuecomment-495077911


IOptions<EsiConfig> config = Options.Create(new EsiConfig()
{
    EsiUrl = "https://esi.evetech.net/",
    DataSource = DataSource.Tranquility,
    ClientId = "**********",
    SecretKey = "**********",
    CallbackUrl = "",
    UserAgent = "",
    AuthVersion = AuthVersion.v2
});

EsiClient client = new EsiClient(config);```
samuelgrant commented 5 years ago

I thought I had added JWT Validation but it looks like I missed it. I'll try to add it to my branch tomorrow.

seraphx2 commented 5 years ago

I am going to be doing some work on ESI finally this weekend. Can you confirm wither this code is complete and ready to be used? Does it conflict with #24 at all?

samuelgrant commented 5 years ago

The Short Version: NO

I was using your application for API calls but not authentication as I had written my own solution for auth. However, I found I needed to use elements of your SSO code for authenticated ESI calls. I ended up changing your library so I could use CCPs V2 oauth, but when I opened this PR I had forgotten to include JWT validation. Since then my out of Eve life has exploded and I have stopped playing.

You are more than welcome to further develop on this branch if my changes are useful, but you will need to implement JWT validation. Please accept my apologies for failing to finish this pull request.

Done

Not Done

Eve SSO V2 docs