Java Eve Esi (Help)

Hello everyone, I am currently working on a Java-Based program for my corporation but I am having a bit of issues with the SSO Auth. I am currently using the Eve-Esi Api!

I do have my program to were it will actually connect to the Website when I am using Microsoft Edge but it only pulls up a login page! So I decided to change my default browser to Google Chrome and now I am recieving error listed right below.

Error

{"error":"invalid_scope","error_description":"The requested 'esi-markets.read_character_orders.v1' scope is not valid."}

Additional Files

========================================================

Main.java

Consule Log

"C:\Program Files\Java\jdk-17.0.1\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3.2\lib\idea_rt.jar=50385:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3.2\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\gam3r\Desktop\PetMaster\PetmasterwoMiniMsg\ZCorps-Eve-Esi\target\classes zcorps.eve_esi.Main
https://login.eveonline.com/v2/oauth/authorize/?response_type=code&redirect_uri=eveauth-app://callback/&client_id=ef8b4e82383e4173bb99983165a37c03&scope=esi-markets.read_character_orders.v1&code_challenge=MmQzMzcxYmYtY2ZiYS00NzExLTk1NTEtN2MxOTJhZTgxM2Uy&code_challenge_method=S256&state=aj2nzcr6a9tu2ag

Process finished with exit code 0

Any help would be greatly appreciated, Thank you all in advance! I have spent probably 2 days now looking at 3+ yr old tutorials on youtube for PHP, Python and a couple other Languages and to no prevail nothing I have tried seems to help. I understand the languages above aren't Java but I was attempting to "Convert", if that's the right term to use from those languages to Java!

  1. Did you add the scope to you dev app?
  2. Are you url encoding everything that needs to be url encoded?
  3. Check ESI Documentation | esi-docs to see if you’re doing everything correctly.

I have a java library that handle all the OAuth stuff for you, if you don’t want to do it all yourself:

Thank you I will go ahead and check it out, I have checked out several other libraries with bare to no documentation on how to use it get started etc… I would also like to eventually learn all the basics so that I am not constantly having to rely on other API’s that may go out of date etc. Thank you for the help :smiley: Defintly checking it out now!

I would also just like to throw out there I am brand new, No experience once so ever with Eve Esi. I have read all of the github documentation. So with your api when I instantiate a new APIClient what do I do afterwards??? I have seen this API before and honestly it is very bare boned on details for brand new Eve Players to jump straight into and use! I spent 2 hrs fiddling with all the methods of APIBuilder and it didn’t work at all :confused: I probably just did it wrong but who knows.

Example of how to get an refresh token: eve-esi/SsoAuthTest.java at master · burberius/eve-esi · GitHub

You will need one ApiClient per refresh token.
Refresh token example (untested, but, you should get the idea):


String refreshToken = ""; //You're refresh token from above
String clientID = ""; //You're clientID from https://developers.eveonline.com/applications
String userAgent = ""; //A good user-agent, see https://docs.esi.evetech.net/docs/esi_introduction.html#user-agent

ApiClient apiClient = new ApiClientBuilder().refreshToken(refreshToken).clientID(clientID).userAgent(userAgent).build()
AssetsApi assetsApi = new AssetsApi(apiClient);

final OAuth auth = (OAuth) apiClient.getAuthentication("evesso");
JWT jwt = auth.getJWT();
JWT.Payload payload = jwt.getPayload();
int charaterID = payload.getCharacterID()
int page = 0; //See x-pages example: https://github.com/burberius/eve-esi/blob/master/src/test/java/net/troja/eve/esi/api/MarketApiTest.java#L234
ApiResponse<List<CharacterAssetsResponse>> apiResponse = assetsApi.getCharactersCharacterIdAssetsWithHttpInfo(charaterID, null, null, page, null);

direct access with cache to data, including connected

You should make a PR to add that to Awesome Eve

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.